how to extract depth from a single image and give me matlab code

extract depth from monocular image.

1 Comment

I want somebody to explain me the steps to extract gray level depth map from a single 3D anaglyph image

Sign in to comment.

Answers (2)

What's your input? For example profilometers use projected stripes and look at the amount the stripes wiggle to convert that into a height. But even profilometers rely on multiple images. An image from Kinect (which I haven't played around with) is already a depth map based on time of flight. There are some other methods that estimate whether an object in the image is close (foreground) or distant (background) but they're based on multiple frames. And you can also get depth if you have a lightfield (Lytro) camera. So, despite the enormous wealth of information you provided in your question, there is still not enough to answer you.

11 Comments

can u please give me any working matlab code that will extract depth of an single image
Post an example image and we will have a look to see if it is practical.
1st is the input image,2nd is the output image please reply us
The image you provide cannot be used to extract depth information by itself. If information was provided about the camera lens it might be possible to get further.
What just might be possible is to extract information about what portions are probably "on top" of other portions, without being able to figure out how far away each portion is. I do not know, however, what the algorithm might be for this.
In this abstract i am implementing only depth estimating,please help me and give some matlab code
I've seen this kind of thing before. In fact a couple of weeks ago I was talking about it with Professor Hank Dietz from the University of Kentucky who also has a paper on it. Through a color coded aperture over the front of a point and shoot camera he can take 3D anaglyph images with a single shot. His web site has instructions for doing it. Requires colored glasses to view in 3D. He uses a super computer to do that processing (because he's lucky enough to have one) and I don't think he does it with MATLAB. But like Walter said, I don't think you can do a good job with just an ordinary color image. In this method you need to exploit the fact that the red and blue images are slightly offset from each other. Contact your authors and ask them if they have MATLAB code. Walter and I certainly don't have code for this. If you write some, then feel free to upload it to the File Exchange, if you can make it general enough.
my input is 3D anaglyph image.I want to extract gray level depth map from it
I had discussion with you earlier. But this time I want to extract the depth of the object.
These two images, where one consist only stripes with fixed width and second with the object. In the second image we can see the shifting in the stripes and it is due to the depth of the object.
I have all known parameters. As this is based on traingulation technique. where we need some info. which is as following:
distance between projector and reference plane: 225 cm
object distance: 8 cm
distance between projector and object : 217
camera from projector: 50 cm
I would like to show the depth as a 3D graph.
Any lead would be helpful.
@Ayush singhal, sorry I don't have any code to construct a topographic image from a series of striped structured light photos. All I can do is to point you to the Image Processing Literature:
in this link, when we scroll down some picture like hammer and so on. where hammer is extracted and shown in 3D graph.
Is it possible to do with my images. Is there any code by whihc the object can be extarcted and shown in this way?

Sign in to comment.

4 Comments

In the below code, where first image is only stripes and second one is with object. When we run this and see the 3D picture, then in the output image we can see that object consist only shifted stripes.
Is it possible to know the pixel values of these shifted stripes, if we consider first image as reference.
You posted those image before.
This is not an image analysis task that I have done before, so I would have to think about how to do it. I am currently overloaded with dealing with other people's requests, and I have a bunch of systems administration work to do as well. Your request is going to fall off my pile.
This is more of an algorithm question more than a MATLAB programming question. None of us here can write you a turnkey, robust, structured light analysis program. It would simply take way too much of our time. Like months instead of minutes. You also need to know a lot obout the optics and geometry of the situation. I suggest you just buy or rent a commercial profilometer -- they have it all worked out already and will even train you. It's the fastest way to get on with your task. If you still want your own MATLAB code to do it, there is someone who would happily do it for you. Click this link.

Sign in to comment.

Asked:

on 14 Apr 2014

Commented:

on 23 Jun 2021

Community Treasure Hunt

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

Start Hunting!