MATLAB: How to convert a 2d image into a 3d one

2d 3d

My idea would be to be able to display a 2d image (8bit)in one in 3d with the depth that is a function of the different brightness level (0 = black, 255 = white). How could I do? Thank you

Best Answer

You could use surf to display the grayscale matrix. An example:
G=imread('cameraman.tif')
surf(G,'edgecolor','none')
colormap(gray)
Related Question