View Single Post
  #5   Spotlight this post!  
Unread 09-01-2012, 19:18
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,751
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: Advanced Vision Concept [help!]

Ahh. I get your goal now. You aren't worried about where the robot is, you want the camera to be centered on a goal/target.

This is covered in the white paper under the position section. The typical coordinate system used in images processing with NI-IMAQ is 0,0 at the top left and the resolution X,Y at the lower right of the image. Fine for image processing, but not all that great for targeting or aiming. To translate to a new coordinate system, you first need to define what the new system is, and you are doing that.

To simplify a bit, the paper defined the new coordinate system as 0,0 in the center with the edges being either 1 or -1. This matches the joystick and servo range nicely and also tends to be something easy to remember for feeding into PID algorithms. To do the coordinate system transform I describe, you subtract the target location and the center of the image, which is half of the resolution. This gives you a system that ranges from resolution/2 to negative resolution/2. Next step is to divide by resolution/2 and potentially invert an axis if you wish. If you'd like to use a different system, you can then scale back to radians, degrees, or anything else you'd like.

If that didn't make sense, please try reading through the white paper from the NI site CD/media/papers and see if that helps.

Greg McKaskle
Reply With Quote