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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
suja snipped-for-privacy@yahoo.co.in wrote:

"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):
http://www.robin-hewitt.com/cv.html
-- Gordon
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
suja snipped-for-privacy@yahoo.co.in wrote:

I have seen a demonstration of doing this by using mirrors to create a stereo view of the object from a single camera.
http://www.ingrit.com/ingolf/robotics/index.htm
Ed
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
suja snipped-for-privacy@yahoo.co.in wrote:

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: http://www.servomagazine.com/store.php?page 05, 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!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@gmail.com wrote:

<snip>
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:
http://www.leafproject.org/
-- Gordon
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Thanks for the correction. Sorry Robin! Great articles though.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
The best solution is to google for articles which use the best research field for this, "time to impact using optic flow"

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
suja snipped-for-privacy@yahoo.co.in wrote:

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.