Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Changing tracked color (http://www.chiefdelphi.com/forums/showthread.php?t=50738)

Guy_E 26-12-2006 15:43

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

Re: Changing tracked color
 
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

Re: Changing tracked color
 
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

Re: Changing tracked color
 
Quote:

Originally Posted by divergentdave (Post 545425)
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

Re: Changing tracked color
 
Take a look at the Track_Color() function in kevin watson camera.c

www.kevin.org/frc

Guy_E 27-12-2006 11:12

Re: Changing tracked color
 
Thanks guys, I think I got it.

teh_pwnerer795 28-12-2006 01:52

Re: Changing tracked color
 
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

Re: Changing tracked color
 
I think you need to put the camera in raw mode first


All times are GMT -5. The time now is 01:19.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi