Go to Post Must...squish....bugs... :p - nighterfighter [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 19-01-2012, 18:38
Citrus Citrus is offline
Registered User
FRC #1678
 
Join Date: Jan 2012
Location: Davis, CA
Posts: 3
Citrus is an unknown quantity at this point
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.
  #2   Spotlight this post!  
Unread 19-01-2012, 19:57
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Calculating distance with an Axis Camera 206

How are you calculating the distance using the camera?

Greg McKaskle
  #3   Spotlight this post!  
Unread 19-01-2012, 23:12
Matt H. Matt H. is offline
Long Distance Mentor
FRC #1726 (N.E.R.D.S.)
Team Role: Alumni
 
Join Date: May 2006
Rookie Year: 2007
Location: Sierra Vista, AZ
Posts: 238
Matt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond repute
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by Greg McKaskle View Post
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.
  #4   Spotlight this post!  
Unread 20-01-2012, 07:01
Chris_Elston's Avatar
Chris_Elston Chris_Elston is online now
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
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.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #5   Spotlight this post!  
Unread 20-01-2012, 10:43
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by Chris_Elston View Post
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?
  #6   Spotlight this post!  
Unread 20-01-2012, 13:10
MysterE's Avatar
MysterE MysterE is offline
FRC Team #3337
AKA: Coach Eiland
FRC #3337 (Panthrobotics)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baton Rouge
Posts: 510
MysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond reputeMysterE has a reputation beyond repute
Send a message via AIM to MysterE
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by Chris_Elston View Post

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.
__________________
Coach. D. Eiland
Head Coach - Team #3337
Panthrobotics (Woodlawn HS)
2016: Bayou Regional WFFA Winner
2016: Rocket City Regional Judges Award
2015: Bayou Spirit Award, Bayou Chairman's Award, Bayou Dean's List Finalist (Danielle Massey), Bayou Volunteer of the Year Award
2014: Bayou Dean's List Finalist (Witni Widmeier)
2011: Bayou Regional Winner | Judges Award
2010: Rookie Inspiration Award
  #7   Spotlight this post!  
Unread 20-01-2012, 14:08
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
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
  #8   Spotlight this post!  
Unread 20-01-2012, 14:48
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
There are numerous algorithms... we are trying opencv with relatively little success.

Anyone else have better experiences with opencv?
  #9   Spotlight this post!  
Unread 20-01-2012, 15:12
commonsense commonsense is offline
Registered User
FRC #3452
 
Join Date: Jan 2012
Location: Berrien Springs FRC
Posts: 16
commonsense will become famous soon enoughcommonsense will become famous soon enough
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?
  #10   Spotlight this post!  
Unread 20-01-2012, 15:17
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by commonsense View Post
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.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #11   Spotlight this post!  
Unread 20-01-2012, 17:16
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by MysterE View Post
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.
  #12   Spotlight this post!  
Unread 21-01-2012, 02:17
Citrus Citrus is offline
Registered User
FRC #1678
 
Join Date: Jan 2012
Location: Davis, CA
Posts: 3
Citrus is an unknown quantity at this point
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.
  #13   Spotlight this post!  
Unread 21-01-2012, 09:22
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
About opencv...

I personally would like to mount a netbook on the robot
  #14   Spotlight this post!  
Unread 21-01-2012, 10:42
MotorHead's Avatar
MotorHead MotorHead is offline
Programming Mentor
AKA: Jeff Beltramo
FRC #1922 (OZ-Ram)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Concord, NH
Posts: 68
MotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to behold
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.
__________________
Jeff Beltramo
Team #1922
Concord, New Hampshire

  #15   Spotlight this post!  
Unread 21-01-2012, 16:48
Solauj's Avatar
Solauj Solauj is offline
Registered User
FRC #0461 (Westside Boiler Invasion)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: West Lafayette
Posts: 4
Solauj is on a distinguished road
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.
__________________
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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