Go to Post just remember, with power comes responsibility. - Mike Ciance [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-01-2006, 10:50
Terry Sherman's Avatar
Terry Sherman Terry Sherman is offline
Mentor -- Software
FRC #0093 (NEW Apple Corps.)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2003
Location: Wisconsin
Posts: 25
Terry Sherman is an unknown quantity at this point
FRC Camera code in YCrCb Mode?

It seems to me that the default 2006 Camera Code provided by Kevin Watson (Thanks Kevin) is configured for YCrCb. Is that true? The students haven't found a way to change the color modes within the robot controller code. We haven't gotten our Green Light built yet so we've been trying to track in RGB without any success. It tracks just fine using the LabVIEW program when selected as RGB. We use Kevin's handy menu system to store these parameters gotten from LabVIEW into the Robot Controller's EEPROM but the robot controller does not successfully track based on those parameters (hence our thought that the default camera code utilizes YCrCb instead of RGB). Any help on how to change the color modes would be greatly apreciated!

Thanks,
-Terry
  #2   Spotlight this post!  
Unread 14-01-2006, 14:43
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Terry Sherman
It seems to me that the default 2006 Camera Code provided by Kevin Watson (Thanks Kevin) is configured for YCrCb. Is that true?
Yes, it's setup for YCrCb tracking. To change it to RGB you'll need to get a copy of the camera module data sheet from my website and figure out which bits to twiddle in the advanced settings portion of the camera header file and/or camera menu. If I remember correctly, the bits are in the COMA register.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 14-01-2006, 17:32
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Kevin Watson
Yes, it's setup for YCrCb tracking. To change it to RGB you'll need to get a copy of the camera module data sheet from my website and figure out which bits to twiddle in the advanced settings portion of the camera header file and/or camera menu. If I remember correctly, the bits are in the COMA register.

-Kevin
wow... wish i knew that 4 hours ago... we have been trying to use the camera with RGB values this whole time...

It tracks perfectly now
  #4   Spotlight this post!  
Unread 14-01-2006, 17:35
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Kevin Watson
If I remember correctly, the bits are in the COMA register.
-Kevin
Yes, set COMA (Register 18) to equal 8 (enable raw mode).

The camera command would be "CR 18 8" for RGB, and "CR 18 0" for YCrCb.
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #5   Spotlight this post!  
Unread 14-01-2006, 17:53
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Eldarion
Yes, set COMA (Register 18) to equal 8 (enable raw mode).

The camera command would be "CR 18 8" for RGB, and "CR 18 0" for YCrCb.
You can try this right from the camera menu. Just select the COMA register, enter the new value, hit enter, save changes, and then restart the camera. You should now be using RGB color space.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 15-01-2006, 14:27
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: FRC Camera code in YCrCb Mode?

I think we were having this same problem, as we could not get the camera to track when connected to the robot with either the default values or those found in LabVIEW (it tracked fine when driving the servos itself, but I only tried RGB mode). I'll have to wait until tomorrow to test it, though.

Are the calibrations still in R,G,B maximum and minimum values, as this is the only option that I can find in the camera configuration? If so, do I just calibrate the RGB values through LabVIEW (in YCrCb mode) and then enter them into camera.h here:
Code:
#define R_MIN_DEFAULT	85	// Rmin for call to Track_Color()
#define R_MAX_DEFAULT	115	// Rmax for call to Track_Color()
#define G_MIN_DEFAULT	15	// Gmin for call to Track_Color()
#define G_MAX_DEFAULT	17	// Gmax for call to Track_Color()
#define B_MIN_DEFAULT	100 // Bmin for call to Track_Color()
#define B_MAX_DEFAULT	145 // Bmax for call to Track_Color()
i.e, Am I supposed to still calibrate as RGB values in YCrCb mode? The workbook seems to indicate this, but it does not give instructions for entering the calibration into anything other than easyC.
__________________
FRC Volunteer, FLL regional planning committee member for Colorado
Former Programmer, Web Designer, Communications Director of Alpine Robotics Team 159.
Add your team to the FIRST Teams Google Map
  #7   Spotlight this post!  
Unread 15-01-2006, 15:36
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Damian Manda
I think we were having this same problem, as we could not get the camera to track when connected to the robot with either the default values or those found in LabVIEW (it tracked fine when driving the servos itself, but I only tried RGB mode). I'll have to wait until tomorrow to test it, though.

Are the calibrations still in R,G,B maximum and minimum values, as this is the only option that I can find in the camera configuration? If so, do I just calibrate the RGB values through LabVIEW (in YCrCb mode) and then enter them into camera.h here:
Code:
#define R_MIN_DEFAULT	85	// Rmin for call to Track_Color()
#define R_MAX_DEFAULT	115	// Rmax for call to Track_Color()
#define G_MIN_DEFAULT	15	// Gmin for call to Track_Color()
#define G_MAX_DEFAULT	17	// Gmax for call to Track_Color()
#define B_MIN_DEFAULT	100 // Bmin for call to Track_Color()
#define B_MAX_DEFAULT	145 // Bmax for call to Track_Color()
i.e, Am I supposed to still calibrate as RGB values in YCrCb mode? The workbook seems to indicate this, but it does not give instructions for entering the calibration into anything other than easyC.
Remember that when you change color domains, the meaning of the registers change, but the names do not. For this reason, it can be a bit misleading when using the "other color space" (i.e. not the one for which the registers are named). When you are YCrCb mode, the registers have the following meaning:

Code:
R.min = Cr.min
R.max = Cr.max
G.min = Y.min
G.max = y.max
B.min = Cb.min
B.max = Cb.max
Make sure that whatever color space you use to find your values in the Labview CMUcam2 Application is the same color space you use on the camera in the RC code. Also don't forget that when you change modes in the LabView CMUcam2 Application, you need to upload the settings to the camera before they will take effect.

Hope this helps to clarify.

-Joe
  #8   Spotlight this post!  
Unread 15-01-2006, 17:50
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: FRC Camera code in YCrCb Mode?

Thanks for clarifying, I figured that they would change. I just didn't know if there was some other place with constants for YCrCb mode that I was missing. No I have something to test out tomorrow.
__________________
FRC Volunteer, FLL regional planning committee member for Colorado
Former Programmer, Web Designer, Communications Director of Alpine Robotics Team 159.
Add your team to the FIRST Teams Google Map
  #9   Spotlight this post!  
Unread 16-01-2006, 23:47
Terry Sherman's Avatar
Terry Sherman Terry Sherman is offline
Mentor -- Software
FRC #0093 (NEW Apple Corps.)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2003
Location: Wisconsin
Posts: 25
Terry Sherman is an unknown quantity at this point
Re: FRC Camera code in YCrCb Mode?

Thanks! We finally got our Green Light fromt the kit going (we had troubles buying the proper case for it). With YCrCb we are getting good results!
-Terry
  #10   Spotlight this post!  
Unread 25-01-2006, 16:43
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: FRC Camera code in YCrCb Mode?

Quote:
Originally Posted by Kevin Watson
You can try this right from the camera menu. Just select the COMA register, enter the new value, hit enter, save changes, and then restart the camera. You should now be using RGB color space.

-Kevin
Is this new value 8? Just want to make sure.

Thanks
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
CMUCam2 code (FRC and EDU?) Amber Programming 0 15-02-2005 22:23
Camera Code Fishdude404 Programming 1 25-01-2005 18:59
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11


All times are GMT -5. The time now is 14:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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