Go to Post I would not want the task of devising a system that 50,000 very smart people try to outwit. - texarkana [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-07-2014, 00:19
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Regression for calculating Distance

So I decided to write a script that outputs an equation when you input 2 variables: how "high" on the image your target is (target.y component) and distance. What is required it to record the .y value, and move the camera to various distances(CAMERA IS REQUIRED TO BE AT THE SAME HEIGHT FROM THE FLOOR), the more the better the regression will predict, then plug it into the script.

It will output 3 values, theta1, theta2, and theta3. The equation those belong to is: e^(theta1) + e^(theta2*X + theta3), where x is the .y value.

Attached is also a program that is user friendly. You use sliders to adjust the threshold of hue, saturation, and value, as well as the number of dilations, and with it, you can track any color, and you can set it up to output the center coordinate, or print it on the screen.

https://www.dropbox.com/sh/waiisgyzd...Hr3SuvrAPDkjfa

With these 2 resources, anyone should be able to track a target or game piece, and easily get an equation that yields how far away it is.

I hope this helps!
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
  #2   Spotlight this post!  
Unread 12-07-2014, 00:24
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Regression for calculating Distance

So I decided to write a script that outputs an equation when you input 2 variables: how "high" on the image your target is (target.y component) and distance. What is required it to record the .y value, and move the camera to various distances(CAMERA IS REQUIRED TO BE AT THE SAME HEIGHT FROM THE FLOOR), the more the better the regression will predict, then plug it into the script.

It will output 3 values, theta1, theta2, and theta3. The equation those belong to is: e^(theta1) + e^(theta2*X + theta3), where x is the .y value.

Attached is also a program that is user friendly. You use sliders to adjust the threshold of hue, saturation, and value, as well as the number of dilations, and with it, you can track any color, and you can set it up to output the center coordinate, or print it on the screen.

https://www.dropbox.com/sh/waiisgyzd...Hr3SuvrAPDkjfa

With these 2 resources, anyone should be able to track a target or game piece, and easily get an equation that yields how far away it is.

I hope this helps!
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
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 15:05.

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