Go to Post I can still remember how weird it was to look on the other side of our booth and see a kid in a suit tossing purple balls... - OneAngryDaisy [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 29-02-2016, 09:43
barn34's Avatar
barn34 barn34 is offline
Isn't this how Skynet got started?
AKA: William Barnickel
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Metamora, IL
Posts: 243
barn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond repute
Re: Visual Tracking Help

depends what you mean by 'distance' (which side of the target tracking triangle are you looking for). also, depends on what values you're calculating from the image and how you're calculating the angle to target.

the most general way to explain it is that you know how wide the target is (20 inches). you also know how wide the resolution is for the camera (that depends on the camera you are using and how it's set up). same with the field of view, as that's camera dependent.

you can convert how wide the target is in pixels in your camera image to a distance to that target in inches by doing the trigonometry and using the pixels to inches conversion by keeping in mind that the target is 20 inches wide.

that's probably a bit too ambiguous of an answer, but the specifics depend on how you're initially processing the image and calculating that angle to target.
__________________



2016 Einstein Field WORLD CHAMPIONS & Carver Sub-Division Winner (330 & 120 & 1086)
2016 Smoky Mountains Regional Winner (3824 & 4740)
2016 Central Illinois Regional Winner (876 & 2220)
2015 Central Illinois Regional Winner (1756 & 2220)
2015 Rock City Regional Winner (2451 & 1625)
2014 Einstein Field Semi-Finalist & Galileo Division Winner (67 & 973 & 2363)
2014 Wisconsin Regional Winner (1732 & 2202)

--- Industrial Design Award (2010, 2015) ------ Innovation in Control Award (2013, 2014, 2016) ---
--- Quality Award (2015) ---------- Creativity Award (2014) ---------- Visualization Award (2009) ---
Reply With Quote
  #2   Spotlight this post!  
Unread 29-02-2016, 10:58
joeojazz joeojazz is offline
Registered User
FRC #5712
 
Join Date: Jan 2016
Location: Hemlock
Posts: 42
joeojazz is an unknown quantity at this point
Re: Visual Tracking Help

Quote:
Originally Posted by barn34 View Post
depends what you mean by 'distance' (which side of the target tracking triangle are you looking for). also, depends on what values you're calculating from the image and how you're calculating the angle to target.

the most general way to explain it is that you know how wide the target is (20 inches). you also know how wide the resolution is for the camera (that depends on the camera you are using and how it's set up). same with the field of view, as that's camera dependent.

you can convert how wide the target is in pixels in your camera image to a distance to that target in inches by doing the trigonometry and using the pixels to inches conversion by keeping in mind that the target is 20 inches wide.

that's probably a bit too ambiguous of an answer, but the specifics depend on how you're initially processing the image and calculating that angle to target.
I am trying to track the front one mostly. I am tracking the area, width, and height the pixels of the tower then would be 1500 pixels. My camera resolution is 720p HD. Don't know then where to go from there.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-02-2016, 11:16
barn34's Avatar
barn34 barn34 is offline
Isn't this how Skynet got started?
AKA: William Barnickel
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Metamora, IL
Posts: 243
barn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond reputebarn34 has a reputation beyond repute
Re: Visual Tracking Help

of the whole tower? or just the goal target?
__________________



2016 Einstein Field WORLD CHAMPIONS & Carver Sub-Division Winner (330 & 120 & 1086)
2016 Smoky Mountains Regional Winner (3824 & 4740)
2016 Central Illinois Regional Winner (876 & 2220)
2015 Central Illinois Regional Winner (1756 & 2220)
2015 Rock City Regional Winner (2451 & 1625)
2014 Einstein Field Semi-Finalist & Galileo Division Winner (67 & 973 & 2363)
2014 Wisconsin Regional Winner (1732 & 2202)

--- Industrial Design Award (2010, 2015) ------ Innovation in Control Award (2013, 2014, 2016) ---
--- Quality Award (2015) ---------- Creativity Award (2014) ---------- Visualization Award (2009) ---
Reply With Quote
  #4   Spotlight this post!  
Unread 29-02-2016, 13:33
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: Visual Tracking Help

If you know the vertical pixel position of the target in your camera image and the vertical field of view of the camera in both pixels and degrees, you can compute the vertical angle from the camera to the target.

If you know the vertical angle to the target, the height of the target, and the height of the camera, you can compute both the horizontal distance to a point directly beneath the target and the straight-line diagonal distance to the target.

The vertical field of view of the camera in pixels is a constant (720 pixels for a 720p image). The field of view in degrees is also a constant that you can measure. The height of the target is a constant, defined in the field drawings. The height of the camera is something you can define for yourself.

Once you have the location of the target in the image, finding distance is a matter of simple trigonometry.
Reply With Quote
  #5   Spotlight this post!  
Unread 29-02-2016, 14:51
joeojazz joeojazz is offline
Registered User
FRC #5712
 
Join Date: Jan 2016
Location: Hemlock
Posts: 42
joeojazz is an unknown quantity at this point
Re: Visual Tracking Help

Quote:
Originally Posted by Alan Anderson View Post
If you know the vertical pixel position of the target in your camera image and the vertical field of view of the camera in both pixels and degrees, you can compute the vertical angle from the camera to the target.

If you know the vertical angle to the target, the height of the target, and the height of the camera, you can compute both the horizontal distance to a point directly beneath the target and the straight-line diagonal distance to the target.

The vertical field of view of the camera in pixels is a constant (720 pixels for a 720p image). The field of view in degrees is also a constant that you can measure. The height of the target is a constant, defined in the field drawings. The height of the camera is something you can define for yourself.

Once you have the location of the target in the image, finding distance is a matter of simple trigonometry.
Height of target is = 7ft 1in
Height of camera is = 7in
How do I find the vertical angle to the target and the vertical field of view of the camera in pixels. The camera says that its is a 16:9 widescreen I don't know if that the field of view in degrees or what is.
Sorry I'm brand new to this
Link to camera info is http://www.amazon.com/Microsoft-T3H-.../dp/B004ETQHDM
Reply With Quote
  #6   Spotlight this post!  
Unread 29-02-2016, 14:53
joeojazz joeojazz is offline
Registered User
FRC #5712
 
Join Date: Jan 2016
Location: Hemlock
Posts: 42
joeojazz is an unknown quantity at this point
Re: Visual Tracking Help

Quote:
Originally Posted by barn34 View Post
of the whole tower? or just the goal target?
Just the goal target width.
Reply With Quote
  #7   Spotlight this post!  
Unread 29-02-2016, 15:19
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 44
BenBernard is on a distinguished road
Re: Visual Tracking Help

I think you would benefit from reading some of the existing CD threads on this subject, starting with:
http://www.chiefdelphi.com/forums/sh...hreadid=144809
Reply With Quote
  #8   Spotlight this post!  
Unread 29-02-2016, 15:22
joeojazz joeojazz is offline
Registered User
FRC #5712
 
Join Date: Jan 2016
Location: Hemlock
Posts: 42
joeojazz is an unknown quantity at this point
Re: Visual Tracking Help

Quote:
Originally Posted by BenBernard View Post
I think you would benefit from reading some of the existing CD threads on this subject, starting with:
http://www.chiefdelphi.com/forums/sh...hreadid=144809
I don't want to use OpenCV really if I can avoid it. I want to try and get it to work with grip like some of the other users.
Reply With Quote
  #9   Spotlight this post!  
Unread 29-02-2016, 15:31
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 44
BenBernard is on a distinguished road
Re: Visual Tracking Help

Understood...but the math is the same no matter where you get your measurements. We do all (or most of) the math in our robot code, reading values from NetworkTables which be populated by GRIP on the driver station, GRIP on the roborio, or our opencv-based tracker on a raspberry pi.

You need to separate out the problem and focus on the parts separately. GRIP won't tell you distance--but neither will OpenCV. Both will tell you height, width, center X and center Y. You will need to determine the distance to the target based on those inputs, as described in the linked thread.

Last edited by BenBernard : 29-02-2016 at 15:39.
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 01:37.

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