View Single Post
  #7   Spotlight this post!  
Unread 11-04-2016, 17:58
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 408
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: Angle Calculation from image of goal

Quote:
Originally Posted by Jared Russell View Post
This can be a decent enough approximation, but there is a more correct way to do this conversion:

Code:
horizontal_angle_to_goal = atan((goal_x - center_x) / focal_length_pixels)

where:
focal_length_pixels = 
.5 * image_width_pixels / tan(horizontal_field_of_view / 2)
Are you doing linear approximation or using focal length in real life? I figure since atan approximates a line when the camera is near aligned with the goal, the linear approximation would work more or less identically with any moderate framerate. This is certainly useful if the camera isn't aligned with the robot, though!

Quote:
Originally Posted by Jared Russell View Post
There is a reason why our vision system this season uses a device that provides APIs to fetch pixel array size and focal length information from per-device factory calibration
What's your setup for both the camera and processor?
__________________
Reply With Quote