Effacer les filtres
Effacer les filtres

plot a 3D image

1 vue (au cours des 30 derniers jours)
pemfir
pemfir le 5 Nov 2012
I have a 640*480 image in the form of a 3D matrix (it is a 640*480*6 matrix)
there are total of 6 layers
layers 1-3 represent the colors of pixels layers 4-6 represent the coordinates (x,y,z) of the pixel. for example one pixel has the following information: [red green blue x y z] is there an easy way to plot this ?

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Nov 2012
It is not so bad in the narrow circumstance that the coordinates together fill a planar grid. It is only easy in the even narrower circumstance that the planar grid is along the z plane.
If this condition does not hold, then you are probably not going to be able to form an "image" in the usual sense.
Does the data represent volumetric data over a completely filled cuboid grid? Or volumetric over a sparse grid? Or is it just a set of scattered point-like objects? Or is it sampled data on a surface that should be implicitly smoothly connected to the points closest to it?
  3 commentaires
Walter Roberson
Walter Roberson le 6 Nov 2012
x = YourData(:,1);
y = YourData(:,2);
z = YourData(:,3);
cols = YourData(:,4:6);
pointsize = 10;
scatter3(x, y, z, pointsize, cols);
pemfir
pemfir le 6 Nov 2012
thank you very much !

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