How to create the depth map of a 2D image

 Accepted Answer

Not sure what you're talking about unless you're talking about plotting gray levels as a surface like you'd do with the surf() command. A 2D image could already be a depth map, for example the images I get from my profilometer already represent depth (height) of the sample and I just display them as a regular 2D image using imshow().

5 Comments

Thank you for our reply,
I am actually talking about the gray levels of the 2D image, because my aim is to create the 3D from the 2D image by using the Depth Map of 2D image.....
So can you say your Suggestions...
Thank You.....
surf(YourGrayImage)
Shibin, I gave you a chance to, but you didn't convey any additional information with that response. You didn't say whether surf() met your needs, and your pixel values represented luminance/reflectance/intenstiy values; nor did you say if the 2D image already represented height data as you'd get from a profilometer or some other kind of instrument where the gray levels represent height, depth, or distance. I already said my suggestions and I'm not sure what else to say. You didn't say anything more so I can't say anything more.
I really Sorry for my Mistake...
Actually i am a newer in this DSP Field, Actually i am working with FPGA/ASIC designing...
So i am dealing with the VHDL/Verilog and all....
Now i am doing a project to convert the 2D image/video in to 3D, for that i need the 2D image/Video with its depth map...
Now the images is in the system memory in the form of RGB format... (16 bit representation)...
And i need to represent the gray level according to the depth of the 2D image, means the nearer objects in the image is white and the background images will be dark according to the depth.....
for example the depth map must be like this i need...
http://www.3dphoto.net/forum/index.php/topic,1679.msg11054.html?PHPSESSID=899141a4855c840ed92723a268417e0e#msg11054
Anyway now i didnt checked the surf() function yet, will check it soon...
I will say my status after the implementation of the surf() function...
Thank you for your reply and response...
Do you have a stereo pair of images? If not, there is no automatic way to construct a depth map, though there is a large research literature on how to obtain some information about depth relations in a single image. If you are starting from a stereo pair, then you need to look at the many algorithms for stereo reconstruction. Looking at your example, I doubt that the surf function will help you.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!