How to calculate depth of focus

I am developing a robot which has a single arm and one webcam that acts as eye to it. The webcam captures the image of the object. But how to calculate the distance or depth of focus so that the robot can move to that particular distance and pick up the object. The information that i have is only the image of that object

Reply to
suja_rajesh
Loading thread data ...

"Depth of focus" is the range at which an object is focused by a lens. Most Webcams focus from a couple inches (maybe 6-8") to infinity. I'm not sure this is what you're looking for here, but maybe you could elaborate.

For general information about computer vision and track planning see this link, for starters (and follow the other links):

formatting link

-- Gordon

Reply to
Gordon McComb

I have seen a demonstration of doing this by using mirrors to create a stereo view of the object from a single camera.

formatting link
Ed

Reply to
Ed Okerson

Well I think I know exactly what you need. If you're not familiar with Nuts and Volts Magazine, and Servo Magazine, I highly recommed you check them out, they have tons of excellent articles on all aspects of robotics and electronics from beginner through to advanced concepts.

There is one particluar set of articles by Robin Hewitt which was published over 5 issues of Servo in 2005 called 'The Gift of Sight'. In the articles Hewitt goes through all of the math and theory behind using a single camera for calculating depth and locating objects in space, and works step by step through an example application. He also goes into detail on how to create a 'home' marker that the robot can recognize and navigate to. These articles probably explain everything you need to at least give you a good grounding and some starting applications. The articles are in the July through November 2005 issues. You can purchase back issues for $5 each here:

formatting link
or you can also purchase a CD of back issues for $30 however it doesn't look like they have 2005 on CD available yet.

Even if you do buy the print issues it would only be $25 and the other articles are definitely worth the price. I guess I sound like a shill for them but I've been subscribed to both magazines for 2 years now and I have learned a slew of new concepts and technologies that I otherwise would not have been exposed to in online robotics forums.

These articles should be what you need, however one note: in order to calculate depth locations in the manner they do in the article you must have images from two different locations, so you may need to construct a mechanism for moving the camera locations. I think you can calculate using images that are only 6 inches apart so perhaps just a moving slider with the camera mounted to it. Although you may be able to calculate depth if you have some sort of visual cues in your frame of vision to reference relative to the target object. Good luck!

Reply to
SwarmMaster

BTW, Robin is a she.

Robin's work is demonstrated in the open source "Leaf Project" robots she, Alex Brown, and Bruce Weimer have developed:

formatting link

-- Gordon

Reply to
Gordon McComb

Thanks for the correction. Sorry Robin! Great articles though.

Reply to
SwarmMaster

The best solution is to google for articles which use the best research field for this, "time to impact using optic flow"

Reply to
Mechanic

A simple method is to mount a laser pointer directly above or below the camera. Scan the center column of the image to determine where the laser hits the target. Then use trig to calculate the distance. Even easier, construct a look-up table by placing a target at known distances and measuring the pixel location. The look-up table would probably be more accurate (harder to mess up, and camera images usually have distortion).

Plus it looks cool.

Daniel

Reply to
D Herring

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.