plot a 3D image
4 views (last 30 days)
Show older comments
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 ?
0 Comments
Accepted Answer
Walter Roberson
on 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 Comments
Walter Roberson
on 6 Nov 2012
x = YourData(:,1);
y = YourData(:,2);
z = YourData(:,3);
cols = YourData(:,4:6);
pointsize = 10;
scatter3(x, y, z, pointsize, cols);
More Answers (0)
See Also
Categories
Find more on Read, Write, and Modify Image in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!