Quote:
Originally Posted by RyanN
Ahah! So that's what they want you to figure out. Look at what data is available to you. Isn't there a nice array of targets found? How about simpiy index the first array element. Now what does each element of the array hold? Well there is an X and Y coordinate. When you're centered on the target, x should read 0.
|
Depending on how you processed your image, you might just get the x,y of the
pixel coordinates. So if this is the case, and you want a number -1<=x<=1, use this formula:
drivingValue = (pixelValue - (maxImageDimension / 2)) / (maxImageDimension/2)
where
maxImageDimension is the size of that image axis.
That way, you can get an value between that could easily be plugged into an algorithm or speed controller. (ex. 640,480 turns to 1,-1)
Hopes this helps. Good luck tomorrow! (I Wish my team was doing something offseason)