View Full Version : Changing tracked color
Hi,
I have a small question. Let's say I wanted to change the color the camera tracks during the game (for example from green to red). Do I need to change the R_MIN, R_Max etc. defines in camera.h or is there something else I need to do?
Thanks,
Guy
Tom Bottiglieri
26-12-2006, 16:16
Yes, that is all you need to do. You can figure out what your defined limits are by playing around with the LabView CMUCam workspace or the CMU Java App.
divergentdave
26-12-2006, 18:32
That will work if you just want to track a different color for the whole game, but it sounds like you want to switch to a new color after you've been tracking one color for a while. If you want to change colors on the fly, then you'll need to send a \r to the camera to stop tracking the current color, and then send it a new TC command with the new color.
Greg Marra
26-12-2006, 19:02
That will work if you just want to track a different color for the whole game, but it sounds like you want to switch to a new color after you've been tracking one color for a while. If you want to change colors on the fly, then you'll need to send a \r to the camera to stop tracking the current color, and then send it a new TC command with the new color.
This is correct. Changing the defines will change the color the camera tracks, but to change the defines requires you to recompile, which is difficult to do on the field. You will want to write some functions to re-initialize the color tracking on the camera on the field, updating it with the new color values to track.
bear24rw
26-12-2006, 22:41
Take a look at the Track_Color() function in kevin watson camera.c
www.kevin.org/frc
Thanks guys, I think I got it.
teh_pwnerer795
28-12-2006, 01:52
I also have a question... say if the camera is searching for a color... and you want to switch the color its tracking.. should you say Camera_Idle(); ...Track_Color(R,R,G,G,B,B).... then Servo_Track();?
bear24rw
28-12-2006, 12:12
I think you need to put the camera in raw mode first
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.