Go to Post I'm 5'5", and I'm our team's drive coach. Our drivers are nearly always taller than me. In my case, it's not the driver's station that needs to be made of lexan...it's our drivers. - StephLee [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 18-03-2009, 00:55
Green2 Green2 is offline
Registered User
FRC #2338
 
Join Date: Mar 2009
Location: Oswego
Posts: 20
Green2 is an unknown quantity at this point
Camera bug and Suggestions to locate green

Inaugural post!!

I'm a mentor for team 2338. I apologize for somewhat a lengthy post, but figure this might help teams that are having camera issues as I noted a couple of teams (including us) were on the field for camera calibration this past weekend.

After endless number of hours troubleshooting the camera code, I think we have found a potential bug in the camera software that is causing the green color detection to be flaky.

I think the issues resides in the code where it takes an RGB image and convert it to HSL for color detection. At times, the resulting HSL image will output a red/pink hue value that is in the single digits (normal red/pink hue is supposed to be from 220 to 255, but the converted HSL image will indicate some red/pink pixels are in the range of 1 to 5. This usually occurs when the target hue value is near the higher value of 255. The only conclusion that I can make is that there is a bug in the conversion code where it is not converting the red hue range properly. I believe that this bug is causing pink detection to fail at times. When pink fails, green natually also fails.

Note that this was communicated to a NI rep in the Wisconsin regional (named Chris, I believe).

Now on to camera calibration to reduce “washed out” targets.

Not to say that this will work all the time, but I think our camera was tracking much better after following this process. Note that a lot of this information was gathered here from the likes of Greg and couple of other helpful folks:

- Start the camera by setting white balance and exposure to “auto”.

- Performing a white balance calibration and set white balance to “hold current”

- This can be done by covering the lens for about 5 seconds and then placing a white sheet of paper in front of the camera after uncovering the lens. Wait for it to self adjust to the correct level and then set to “hold current”.

- Perform an exposure adjustment:

- This is where I tend to disagree with Greg on keeping auto exposure. We find it to work much better if we fix the exposure. The reason being that out camera is aimed relatively high, and it will catch some of the lamps that are used to light up the field. When and if that happens, the exposure time tends to reduce and it is those times that we obtain a correct target exposure. If the camera is aimed at an area where there is relatively low back lighting, the camera will over expose. Causing a washed out target to show up. To set the exposure, we aim the camera towards some lights to force exposure time down. While at the same time, we place a target in front of the camera to check exposure. When you can clearly see the distinctive colors in the target with lights in the background without much glare, set the exposure to “hold current”. Any additional glare can be reduced by setting a lower brightness level. The beauty of fixing the exposure is that the lighting is relatively uniform from the various angles, thus a fixed exposure will enable target detection no matter what the background lighting conditions are. Now check the HSL values for the 2 target colors and record them. Double check for proper camera exposure by aiming the camera (with a target in view) towards other areas of the field (check with and without back lighting).

After these adjustments, our camera was able to track the target properly. (Ignore the fact that we shot into our own alliance’s trailer in one of the matches…we were still troubleshooting our autonomous code . I forgot which match, but one of our later seeding matches this past weekend we were tracking properly and scored in autonomous (into the correct trailer this time).

That should be it…hope this will help the teams having camera issues.

Best of luck!!
Reply With Quote
 


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
easy-c camera goes to corner when sees green light iiiii Programming 0 12-02-2007 19:07
Green Camera Light Questions Naveen Electrical 18 24-01-2007 22:52
Camera finds overhead lights not green light theycallhimtom Programming 4 20-01-2007 17:37
EasyC and the 8.2/8.3 Volt Bug TubaMorg Programming 2 15-03-2006 11:45
Camera Only Tracking Green sybert1ger Programming 2 08-02-2005 20:21


All times are GMT -5. The time now is 10:35.

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