how to convert a 2D image into a 3D image.

Hi All,Thanks in advance,I want to read an input image and convert it into a 3D image.Could any one show how can I achieve this.the image is color preferably.

Answers (2)

It's hard to know exactly what you mean by convert to a 3D image. Try this:
A = imread('eight.tif');
surf(double(A))
shading flat

2 Comments

I tried this but getting an error Warning: Matrix dimensions must agree, not rendering mesh
You ran different code. I just copied and pasted Chad's code and it worked fine. What did you do differently? You must have changed something that broke it.

Sign in to comment.

A color image is already a 3D image, at least if it's RGB and not indexed color, so you can simply use imread() and you're done!
rgbImage = imread(filename);

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 4 Nov 2014

Commented:

on 5 Nov 2014

Community Treasure Hunt

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

Start Hunting!