Hey I had 360*180 matrix that hold bw image present field of view of camera (azimuth and elevation) I want the plot the field of view on 3d sphere plot...How can i do it?Try to use sph2cart, but get confused... thanks.

 Réponse acceptée

clc; clear all ;
I = imread('cameraman.tif') ;
[m,n] = size(I) ;
[X,Y,Z] = sphere(m-1,n-1) ;
surf(X,Y,Z,flipud(I),'FaceColor','texturemap','EdgeColor','none');
colormap(gray)

4 commentaires

sarel aharoni
sarel aharoni le 17 Sep 2021
Thanks! Its easy to understand, i work great.
I had a only little question left : its binary image, so there is a way make the false spot to be clear? (Not showen or just grid there)
KSSV
KSSV le 17 Sep 2021
Question is not clear.
sarel aharoni
sarel aharoni le 17 Sep 2021
I had balck and white image... I want the white area will plot at the sphere like your code did. But the black area will not plot, and matlab leave this sphere area clear (ball grid only, or hole in the sphere somehow) Hope this is more clear
sarel aharoni
sarel aharoni le 19 Sep 2021
Hay KSSV If i make all '0' spots NaN before draw it will work? And the no-plot the part of sphere?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by