plot a 3D image

1 次查看(过去 30 天)
pemfir
pemfir 2012-11-5
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 ?

采纳的回答

Walter Roberson
Walter Roberson 2012-11-6
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 个评论
Walter Roberson
Walter Roberson 2012-11-6
x = YourData(:,1);
y = YourData(:,2);
z = YourData(:,3);
cols = YourData(:,4:6);
pointsize = 10;
scatter3(x, y, z, pointsize, cols);
pemfir
pemfir 2012-11-6
thank you very much !

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by