how to extract depth from a single image and give me matlab code
Show older comments
extract depth from monocular image.
1 Comment
hidangmayum saxena
on 6 Apr 2015
I want somebody to explain me the steps to extract gray level depth map from a single 3D anaglyph image
Answers (2)
Image Analyst
on 14 Apr 2014
2 votes
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
NITHIN
on 15 Apr 2014
Walter Roberson
on 15 Apr 2014
Post an example image and we will have a look to see if it is practical.
NITHIN
on 15 Apr 2014
NITHIN
on 15 Apr 2014
Walter Roberson
on 15 Apr 2014
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.
NITHIN
on 15 Apr 2014
Image Analyst
on 15 Apr 2014
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.
hidangmayum saxena
on 20 Apr 2015
my input is 3D anaglyph image.I want to extract gray level depth map from it
Ayush singhal
on 6 Jun 2021
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.
Image Analyst
on 6 Jun 2021
@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:
Ayush singhal
on 6 Jun 2021
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?
Walter Roberson
on 14 Apr 2014
0 votes
4 Comments
Ayush singhal
on 7 Jun 2021
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.
Walter Roberson
on 7 Jun 2021
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.
Image Analyst
on 8 Jun 2021
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.
Ayush singhal
on 23 Jun 2021
okah thanks.
Categories
Find more on Process Point Clouds in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!