Go to Post If you don't like contact, your robot is not built well enough. - sanddrag [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, 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,748
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
  #2   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.
  #3   Spotlight this post!  
Unread 20-01-2012, 07:01
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 746
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
  #4   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,112
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?
  #5   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: 509
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
  #6   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
  #7   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.
  #8   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.
  #9   Spotlight this post!  
Unread 30-01-2012, 17:14
dellagd's Avatar
dellagd dellagd is offline
Look for me on the field!
AKA: Griffin D
FRC #2590 (Nemesis) #2607 (The Fighting Robovikings)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2011
Location: PA
Posts: 890
dellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond repute
Re: Calculating distance with an Axis Camera 206

Quote:
Originally Posted by JewishDan18 View Post
Basically, yes. Involves a fair amount of trig, but this is how I am doing it, and it works well.
Correct me if im wrong, but cant you use a exponential regression for the correlation from height of rectangle to distance away (at least it seems a exponential regression is the right way to go)
__________________
Check out some cool personal projects in computers, electronics, and RC vehicles on my blog!

2016 MAR DCMP Engineering Excellence Award
2016 MAR Westtown Innovation in Control Award
2016 MAR Hatboro-Horsham Industrial Design Award
2015 Upper Darby District Winners - Thanks 225 and 4460!
2015 Upper Darby District Industrial Design Award
2015 Hatboro-Horsham District Winners - Thanks 2590 and 5407!
2014 Virginia Regional Winners - Thanks so much 384 and 1610, I will never forget that experience!
2014 Virginia Quality Award
2014 MAR Bridgewater-Raritan Innovation in Control Award
2014 MAR Hatboro-Horsham Gracious Professionalism Award
2013 MAR Bridgewater-Raritan Innovation in Control Award
2012 MAR Lenape Quality Award
  #10   Spotlight this post!  
Unread 31-01-2012, 16:43
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: Calculating distance with an Axis Camera 206

Does OpenCV have a program that will spit out code for you similar to what the NI Vision Assistant program does? It seems like using OpenCV will be easier for my team to implement our rectangle tracking with if it does, as we are having some trouble understanding the code that is spit out by Vision Assistant.
  #11   Spotlight this post!  
Unread 31-01-2012, 20:59
caseydech caseydech is offline
Registered User
None #1391
 
Join Date: Nov 2011
Location: West Chester
Posts: 3
caseydech is an unknown quantity at this point
Re: Calculating distance with an Axis Camera 206

my team uses the axis camera to identify blobs (yes its the technical term for the... blobs that the camera picks up) And then finds the distance based on the pixel distance between top square and bottom square, angle uses trig and distance from side targets, labview can calculate the rest
  #12   Spotlight this post!  
Unread 31-01-2012, 21:21
Derschatten Derschatten is offline
Registered User
FRC #1203 (Pandemonium)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2003
Location: West Babylon
Posts: 31
Derschatten is an unknown quantity at this point
Re: Calculating distance with an Axis Camera 206

I have seen a lot of people over look this in past year. Make sure you are converting it to foot and inches or whatever you desire as 1' would be 1.2 as a double.
  #13   Spotlight this post!  
Unread 01-02-2012, 01:35
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 dellagd View Post
Correct me if im wrong, but cant you use a exponential regression for the correlation from height of rectangle to distance away (at least it seems a exponential regression is the right way to go)
Sure you can, but you need to get a baseline to start from, which can be found by going through the trig for one image, or going to a field and finding it through measurements there.

Quote:
Originally Posted by caseydech
my team uses the axis camera to identify blobs (yes its the technical term for the... blobs that the camera picks up) And then finds the distance based on the pixel distance between top square and bottom square, angle uses trig and distance from side targets, labview can calculate the rest
Yeah, this is what I hope to do, since the error is much less than using a single target. But, if one target is not found, you will need to do the math without it, which makes things very interesting (and a whole lot of if-else, unless I find a more elegant way to do it)
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 18:38.

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