Go to Post If full body suits can be made to fit properly, why do we have so many robots with saggy bumper covers? - GaryVoshol [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2017, 18:32
AriMindell AriMindell is offline
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2015
Location: Maryland
Posts: 28
AriMindell will become famous soon enoughAriMindell will become famous soon enough
Calculate translational distance from vision

I have some experience from last year converting a target location in pixels to an offset in degrees using the FOV of the camera, but I am not sure how to apply that to this year's vision challenge. We are looking to align with the gear peg laterally using vision. Is there a similar equation for converting pixels to translational distance? (Distance we need to slide laterally to get lined up with the peg)


Sent from my iPhone using Tapatalk
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2017, 20:10
KJaget's Avatar
KJaget KJaget is offline
Zebravision Labs
FRC #0900
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Cary, NC
Posts: 51
KJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud of
Re: Calculate translational distance from vision

You'll need to know the distance to the target to make it work.



Pretend the above is a top view of the camera. O is the lens. Y1 is the camera sensor. y1 is the number of pixels off center you are. f is the focal length of the camera. Those are all known locations & values.

So this is a simple similar triangle calculation, if you just know x3.

The problem is that all the pixels along the green line outside of the camera will show up at the same point Q on the sensor. So without knowing the distance x3 you can't figure out how big x1 is (P could be at any point along the green line).

If you can determine distance x3 some other way (ultrasonic, some trig using the distance between the two vision targets) x1 is easy. But any error in x3 will also be an error in x1 so testing is in order.

Last edited by KJaget : 24-01-2017 at 09:43.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2017, 20:11
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 148
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: Calculate translational distance from vision

Quote:
Originally Posted by AriMindell View Post
I have some experience from last year converting a target location in pixels to an offset in degrees using the FOV of the camera, but I am not sure how to apply that to this year's vision challenge. We are looking to align with the gear peg laterally using vision. Is there a similar equation for converting pixels to translational distance? (Distance we need to slide laterally to get lined up with the peg)


Sent from my iPhone using Tapatalk
In order to compute the translational distance, you will need to know how far away from the target you are. Assuming you can compute the distance, one way to compute the translational movement needed would be like this: compute the angle offset in degrees the way you did last year, compute the distance, then use some trigonometry to calculate the "translational distance" (tan(theta) = translation / distance)
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2017, 21:41
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,736
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Calculate translational distance from vision

If you're asking what I think you're asking, use the height of the retroreflective area. Its actual height 5". Divide that by the number of pixels of its height, and you have a good estimate of the image resolution in a direction perpendicular to a (presumably horizontal) camera, and can roughly calculate range.

Alternately, just measure the height in pixels (P0) at a known range R0 (say 10 feet). Then whenever you're looking at the target, R = R0 * P0 / P. Should be close enough to get you going, but it breaks down as you get close to the target and the sine of the angle is no longer proportional to the angle.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2017, 13:26
StormfalconX StormfalconX is offline
Registered User
FRC #2059
 
Join Date: Jan 2017
Location: Cary
Posts: 3
StormfalconX is an unknown quantity at this point
Re: Calculate translational distance from vision

bump
Reply With Quote
  #6   Spotlight this post!  
Unread 28-01-2017, 14:09
StormfalconX StormfalconX is offline
Registered User
FRC #2059
 
Join Date: Jan 2017
Location: Cary
Posts: 3
StormfalconX is an unknown quantity at this point
Re: Calculate translational distance from vision

bump2
Reply With Quote
Reply


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 15:28.

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