Convert 2D image to 3D with color map

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 Kommentar

Guillaume
Guillaume am 11 Jul. 2016
Bearbeitet: Guillaume am 11 Jul. 2016
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?

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Image Analyst
Image Analyst am 7 Jul. 2016

0 Stimmen

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 Kommentare

michael
michael am 7 Jul. 2016
can you please write some short code for this one so that I'll not get lost?
Image Analyst
Image Analyst am 7 Jul. 2016
Make it easy for me by first telling me the coordinates of the rows and columns of the color tiles in your colormap.
michael
michael am 11 Jul. 2016
Bearbeitet: michael am 11 Jul. 2016
more or less like in the above picture. Any way, I'm taking only the actual image, without the color codes while presenting it
Image Analyst
Image Analyst am 11 Jul. 2016
michael, you're confusing everyone. You're going to have to do a lot better job of explaining very specifically what you want if you want help.
A color image is a 3D image. Other people call a rendering (2-D image on your screen) of a surface (like a 2.5-D surface created by the surf function) a 3-D image.
Guillaume
Guillaume am 11 Jul. 2016
I would not call a colour image a 3D image. Yes, it's a 3D matrix but not a 3D image. A 3D image would consist of voxels and as per my comment to the question, I've no idea how you'd display that (with a VR headset?)
Image Analyst
Image Analyst am 11 Jul. 2016
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 am 12 Jul. 2016
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 7 Jul. 2016

Kommentiert:

am 12 Jul. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by