View Single Post
  #2   Spotlight this post!  
Unread 17-02-2012, 21:53
CRLS97 CRLS97 is offline
Registered User
FRC #0097
 
Join Date: Jan 2011
Location: Cambridge
Posts: 28
CRLS97 is an unknown quantity at this point
Re: Fixed indexes for Target Info VI

Quote:
Originally Posted by Pirate programe View Post
We have the Rectangular Target Processing VI imported into the code, but here's the problem: The Target info array is built in the order that they're seen. This means that, if something obstructs the camera on the field, the Target Info VI could potentially be reordered, making it hard to pick a certain target to aim at reliably. So, we'd like to be able to make sure that a target is assigned to a specific index depending on its information, instead.

I have some idea of how to accomplish this: Since the targets are cross-shaped, you can expect them to have close X and Y values; the top and bottom targets will have close X values, and the left/right ones will have similar Ys. From there you could compare certain values to see if they're one of the groups you want, and place them in an array accordingly.

I think the logic is sound (feel free to correct me if I'm wrong), but I'm having trouble with the nuts-and-bolts implementation of it, in LabVIEW code.
From what I recall, and someone correct me if I'm wrong, the targets are in order by the calculated distance. It doesn't matter which target the camera sees first, but whichever target is closest according to the calculations done in the Vision VI.

Also you could go about doing what you just mentioned but also note that since it's in a cross shape and the x returns a value from -1 to 1 and y from -1 to 1, you could also find the maximum and minimum values of x for the horizontal ones and max/min of y for the vertical and use the index # returned and use the information you need from there..
Reply With Quote