Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Calculating distance with an Axis Camera 206 (http://www.chiefdelphi.com/forums/showthread.php?t=100653)

Citrus 19-01-2012 18:38

Calculating distance with an Axis Camera 206
 
My team is using an axis camera to calculate the distance to a target. The distances we are currently calculating are up to a foot off, depending on the location, lighting etc. The calculated distances are worse at angles. What accuracy range are other teams getting? Do you think the camera is the best way to get the distance? We have also done tests with the ultrasonic sensor which is sometimes very accurate and other times gives strange results.

Thank you.

Greg McKaskle 19-01-2012 19:57

Re: Calculating distance with an Axis Camera 206
 
How are you calculating the distance using the camera?

Greg McKaskle

Matt H. 19-01-2012 23:12

Re: Calculating distance with an Axis Camera 206
 
Quote:

Originally Posted by Greg McKaskle (Post 1109312)
How are you calculating the distance using the camera?

I second this question. If you can't get better estimates from the axis camera, you might try using the camera as a sanity check for an ultrasonic sensor.

Chris_Elston 20-01-2012 07:01

Re: Calculating distance with an Axis Camera 206
 
With any vision system, you could fill in the area of the "square" target that is found with the "edge detection". This way you get a solid square.

Once you have a soild square, now run an "area detection" of the square.

This will get you a size. The bigger the area, the closer you are. The smaller the area, the further away you are.

Alan Anderson 20-01-2012 10:43

Re: Calculating distance with an Axis Camera 206
 
Quote:

Originally Posted by Chris_Elston (Post 1109612)
The bigger the area, the closer you are. The smaller the area, the further away you are.

A smaller area could also mean you are just farther away from the line perpendicular to the target, even if you are the same distance from the target itself.

Citrus, what algorithm are you using to compute distance?

MysterE 20-01-2012 13:10

Re: Calculating distance with an Axis Camera 206
 
Quote:

Originally Posted by Chris_Elston (Post 1109612)

This will get you a size. The bigger the area, the closer you are. The smaller the area, the further away you are.

Would it be more accurate to use the ratio of size of the rectangle in comparison to the overall picture (ie. The smaller the rectangle in pixels, the farther away you are moving from it) and then using the length and width of the sides to calculate for angle?

And I'm one of those NEMs (Non-engineering Mentors) so the math escapes me completely here.

cjlane1138 20-01-2012 14:08

Re: Calculating distance with an Axis Camera 206
 
Can someone please post the documentation for detecting the squares and tracking them? I can't seem to find the PDF's or tutorials.

Thanks,
Eagle Engineering 1138

shuhao 20-01-2012 14:48

There are numerous algorithms... we are trying opencv with relatively little success.

Anyone else have better experiences with opencv?

commonsense 20-01-2012 15:12

Re: Calculating distance with an Axis Camera 206
 
With the range finder we received you shouldn't need to use the Axis camera. The real question is has anyone found information for coding the rangefinder?

apalrd 20-01-2012 15:17

Re: Calculating distance with an Axis Camera 206
 
Quote:

Originally Posted by commonsense (Post 1109837)
With the range finder we received you shouldn't need to use the Axis camera. The real question is has anyone found information for coding the rangefinder?

It's analog. It outputs a voltage read as an analog channel.

Relating to OpenCV, this shouldn't be necessary on the cRio as NI Vision (CVI) is fairly optimized (and already compiled) for VxWorks.

JewishDan18 20-01-2012 17:16

Re: Calculating distance with an Axis Camera 206
 
Quote:

Originally Posted by MysterE (Post 1109794)
Would it be more accurate to use the ratio of size of the rectangle in comparison to the overall picture (ie. The smaller the rectangle in pixels, the farther away you are moving from it) and then using the length and width of the sides to calculate for angle?

And I'm one of those NEMs (Non-engineering Mentors) so the math escapes me completely here.

Basically, yes. Involves a fair amount of trig, but this is how I am doing it, and it works well.

Citrus 21-01-2012 02:17

Re: Calculating distance with an Axis Camera 206
 
We are using the height of the target and comparing it to the height of the camera image.

shuhao 21-01-2012 09:22

About opencv...

I personally would like to mount a netbook on the robot

MotorHead 21-01-2012 10:42

Re: Calculating distance with an Axis Camera 206
 
If you haven't already, you should read this white paper on vision and the axis camera. It is from National Instruments and is specific to this years competition. The url is https://decibel.ni.com/content/docs/DOC-20173

You may need to register to download. It provides good detail on the algorithm used and possible errors.

Solauj 21-01-2012 16:48

Re: Calculating distance with an Axis Camera 206
 
We are using OpenCV to track the vision target this year. I have been fiddling around with color tracking over the summer, so I have a little experience with it. I have been able to track the tape up to 16ft. away. Due to a lack of smoked polycarbonate, I don't have the actual vision target built yet.

Does anyone known how dense the polycarbonate is? All the manual says is "1/2 in. smoked polycarbonate" with no more description.

As far as determining distance, I thought using the target's relative size to the image size would be viable because the target is 2ft. wide.

What problems are you having with OpenCV? I'll try to help. Also you should get a hold of the book Learning OpenCV: Computer Vision with the OpenCV Library (ISBN: 978-0-596-51613-0). It's great for reference and (obviously) learning the basics.


All times are GMT -5. The time now is 18:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi