Convert 2D image to 3D with color map

11 次查看(过去 30 天)
Hello,
I have a color image of radiation pattern.
I'd like to convert this image into a 3D image, based on color map (which is coming along with the image).
Example of image that I have.
Please suggest.
  1 个评论
Guillaume
Guillaume 2016-7-11
编辑:Guillaume 2016-7-11
What do you call a 3D image? And how do you intend to visualise it?
Where is the 3rd dimension encoded if you start with a 2D image?

请先登录,再进行评论。

回答(2 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-7-7
Y = ind2rgb(X,map)

Image Analyst
Image Analyst 2016-7-7
That's an RGB image so it's already 3D.
By 3-D, do you mean a surface, like you'd get from surf()? If so, you'll have to read the colors in your color bar and then create a colormap - a 10 by 3 array of RGB colors. Then you'll have to use rgb2ind() to turn that RGB image into a single valued, monochrome image, at which point you can then use surf to make a 2.5-D perspective rendering where the gray level is like a height above the x-y plane.
  7 个评论
Image Analyst
Image Analyst 2016-7-11
I can agree with that. They're both 3D arrays but they're just interpreted differently. One is interpreted as a color or hyperspectral image while the other is interpreted as a grayscale volumetric image. You could even have a 4D array interpreted as a color volumetric image or as a series of color images (like a video). To view a 3-D monochrome or color volumetric image you'd have to use a different program like Avizo, because MATLAB just isn't set up for that kind of visualization and is limited to primitive cut-away slice views and isosurfaces.
michael
michael 2016-7-12
I have 2D image which is colored. I'd like to use the color as the 3rd dimension, based on color map.
In the image which was attached, red has a value of 90 and therefore it would be the highest point in the 3rd dimension, then orange, yellow, green and blue which would be nearly 0 in the 3rd dimension.
Hope that it is more clear now.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by