Go to Post You hang for show; kick for dough. - Travis Hoffman [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 26-02-2009, 16:19
Quarkster Quarkster is offline
Registered User
FRC #2729
 
Join Date: Jan 2009
Location: New Jersey
Posts: 4
Quarkster is an unknown quantity at this point
Target acquisition with camera- color issues

We are at the DC competition and having significant trouble getting the camera to recognize targets.

Our code is based on the example camera code for labview, although teams using C++ could still be helpful to us.

To those teams who have cameras working at the competition, what settings are you using?

One thing that might be an issue is that the camera is supposed to be returning HSL values, but when I probe it in the block diagram, it says we have an RGB image. But it could just be converting it for display purposes
  #2   Spotlight this post!  
Unread 26-02-2009, 16:50
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,350
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Target acquisition with camera- color issues

Quote:
Originally Posted by Quarkster View Post
We are at the DC competition and having significant trouble getting the camera to recognize targets.

Our code is based on the example camera code for labview, although teams using C++ could still be helpful to us.

To those teams who have cameras working at the competition, what settings are you using?

One thing that might be an issue is that the camera is supposed to be returning HSL values, but when I probe it in the block diagram, it says we have an RGB image. But it could just be converting it for display purposes

Have you set the White Balance and Brightness adjustments for the environment you are playing in??
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #3   Spotlight this post!  
Unread 26-02-2009, 19:03
keehun's Avatar
keehun keehun is offline
Team Captain
AKA: Keehun Nam
FRC #2502 (EP Robotics)
Team Role: Leadership
 
Join Date: May 2008
Rookie Year: 2008
Location: Eden Priaire
Posts: 474
keehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond repute
Send a message via AIM to keehun
Re: Target acquisition with camera- color issues

Quote:
Originally Posted by Quarkster View Post
One thing that might be an issue is that the camera is supposed to be returning HSL values, but when I probe it in the block diagram, it says we have an RGB image. But it could just be converting it for display purposes
We noticed this phenomenon as well! We fortunately noticed this mid-season and was able to solve this.


(Sorry the icons are "?"; I'm on my mac and it does not have the WPI library drivers)

I don't know if this will work for you, but this worked for us so I decided to post it. Yes, for tracking, we also use HSL images.

I believe we saw "HSL" in the probe as well. I may be mistaken, but that is what I remember. We observed that the first image going in to the while loop was of HSL kind, but all the subsequent images were in RGB... We thought the "setting" was not retained. We somehow got it to stay in HSL after a long battle.

If you want more help, I can post more code.
__________________
For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast. -- Ephesians 2:8-9
2010: Quarter Finalist (MN 10,000 Lakes)
2010: Website Award (MN 10,000 Lakes)
2009: Quarter Finalist (MN 10,000 Lakes)
2009: GM Industrial Award (MN 10,000 Lakes)

Last edited by keehun : 26-02-2009 at 19:07.
  #4   Spotlight this post!  
Unread 27-02-2009, 06:14
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Target acquisition with camera- color issues

The easiest way to see HSL is to open the Find Two Colors VI. Unless you have the very first release of that example, then panel of that VI has an HSL display on it and a Boolean beneath to turn on the HSL conversion explicitly. This will display HSL so that you can hover with the mouse and make good measurements. If you you don't have this incorporated, you can add it pretty easily. Note that the implicit HSL threshold is faster, which is why this isn't on all the time.

Greg McKaskle
  #5   Spotlight this post!  
Unread 27-02-2009, 06:26
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Target acquisition with camera- color issues

As for values, what I can tell you is that the fields are quite bright and the black curtain also complicates things. When the camera faces the black curtain, it receives less light and increases the exposure time to compensate. Doing this only makes the glare on the targets worse.

Things that will help are listed in the document containing the recommended camera settings. The primary thing is to try lowering the Brightness setting on the camera. This will lower the exposure and keep the targets from being overexposed. Don't be concerned about setting it too low when things are as brightly lit as the event, but you may want to restore it when you return to the classroom or shop setting.

To set brightness in LV, the example was written with this as a parameter which you can change on they fly. Don't forget to make the current value default once you finish experimenting.

Another thing to consider is the effect that bright light has on color saturation. As luminance increases in an image saturation will naturally drop. So in an event where there are bright lights, you will likely see the saturation numbers of everything drop somewhat. When you threshold the image looking for the pretty saturated hues of the target fabric, you are supplying both upper and lower saturation thresholds. If the lower saturation thresholds are too high, you will get streaks and parts of the target image with glare not making it into the mask.

Greg McKaskle
  #6   Spotlight this post!  
Unread 03-03-2009, 18:49
Rich Kressly's Avatar
Rich Kressly Rich Kressly is offline
Robot/STEM troublemaker since 2001
no team (Formerly 103 & 1712. Now run U.P. Robotics (other programs))
Team Role: Mentor
 
Join Date: Oct 2001
Rookie Year: 2001
Location: Pennsburg, PA
Posts: 2,045
Rich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond reputeRich Kressly has a reputation beyond repute
Re: Target acquisition with camera- color issues

Greg! You were a huge help to our team in DC. Thanks! Our cam values from DC are posted in a screenshot here: http://www.chiefdelphi.com/forums/sh...0&postcount=36
__________________
technology, innovation, and invention without a social conscience will only allow us to destroy ourselves in more creative ways
  #7   Spotlight this post!  
Unread 03-03-2009, 19:02
Chexposito's Avatar
Chexposito Chexposito is offline
Registered User
AKA: Expo
FRC #1730
Team Role: Alumni
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Missouri
Posts: 272
Chexposito is a glorious beacon of lightChexposito is a glorious beacon of lightChexposito is a glorious beacon of lightChexposito is a glorious beacon of lightChexposito is a glorious beacon of lightChexposito is a glorious beacon of light
Re: Target acquisition with camera- color issues

i know our programmers messed with the settings to the two game colors became pretty much the only visible colors on the display. making the targets more obvious. ours doesn't track to well because of the problem with one of the axis of rotation being controlled by a motor, instead of servo, which likes to move sporadically. talking to the ni programmer at the kc regional helped a lot.
  #8   Spotlight this post!  
Unread 09-03-2009, 17:23
Andrew Bates's Avatar
Andrew Bates Andrew Bates is offline
Registered User
AKA: Bates
FRC #0125 (NUTRONS)
Team Role: Mechanical
 
Join Date: Apr 2007
Rookie Year: 2004
Location: Ypsilanti, Michigan/Boston, MA
Posts: 332
Andrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond reputeAndrew Bates has a reputation beyond repute
Re: Target acquisition with camera- color issues

Has anyone been able to track a trailer and run traction control at the same time. We have been having trouble with our camera tracking taking to much time to execute causing our traction control to break. We changed it so that when we are tracking our traction control is turned off but this is unsatisfactory for us. Has anyone else had a similar problem?
__________________
ME Student at Northeastern University, Captain of the NUTRONs #125 FRC

Former member of VEXELLENT and Cranbrook Robotics
  #9   Spotlight this post!  
Unread 09-03-2009, 17:28
gwytheyrn gwytheyrn is offline
Registered User
AKA: David
FRC #0461 (West Side Boiler Invasion)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Indiana
Posts: 44
gwytheyrn is infamous around these parts
Send a message via AIM to gwytheyrn
Re: Target acquisition with camera- color issues

I'm not sure if this is just our own problem, but when we run the camera example and the target is near the camera and near the top of the image, the masks begin to split apart, making the script believe that the target leaves the frame before it really should. The higher up the target is, the farther apart the two masks become until the top one flies off the screen (even though a large portion of the color is still on the actual input image). Anyone know a fix for this?
  #10   Spotlight this post!  
Unread 09-03-2009, 18:51
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: Target acquisition with camera- color issues

Quote:
Originally Posted by gwytheyrn View Post
I'm not sure if this is just our own problem, but when we run the camera example and the target is near the camera and near the top of the image, the masks begin to split apart, making the script believe that the target leaves the frame before it really should. The higher up the target is, the farther apart the two masks become until the top one flies off the screen (even though a large portion of the color is still on the actual input image). Anyone know a fix for this?
We have noticed that, so you're not alone, but it does not affect our use of the camera, so I'm afraid I can't offer a solution. Hopefully someone from NI will check this and be able to help you.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
  #11   Spotlight this post!  
Unread 09-03-2009, 19:23
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Target acquisition with camera- color issues

one way to get the hsl or rgb values is to use the dashboard (create a PCVideoServer in C++), and take a pic of the target from the camera. then go into gimp, and crop the green or pink.
for RGB, go to Colors, Info, Histogram, and slect the color field, and you can find out the range of colors for rgb, then do the same for green.
for hsl, go to colors>components>decompose and select hsl. then note the layer name, and then go to colors info histogram, and that is the h s or l max and min. then you can plug them in
Attached Thumbnails
Click image for larger version

Name:	GimpHistogram.jpg
Views:	45
Size:	21.4 KB
ID:	7649  
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #12   Spotlight this post!  
Unread 09-03-2009, 22:13
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Target acquisition with camera- color issues

To learn about the performance, you may want to isolate the tasks and determine the performance characteristics of each independently. If using LV, you can try using the profiler, but as with any advanced tool, it takes a bit of practice to learn how to interpret the feedback.

If you want to use less CPU to process the images, the easiest way with the default code is to shrink the image size or to decimate the image a bit more. I have no idea what your code for traction control does, but if you post it or describe it you may get some input.

The issue with the camera looking up to the target and catching glare is caused primarily by the placement of the lights. I want to try something tomorrow to improve the image. I have the equipment, but I'd rather not post before giving it a try.

If you can't improve the image captured by the camera, you may be able to recognize the situation by noticing that the image, once whole, is splitting, and build the rect to encompass the halves. Tricky, and it'd be much better to have a good image, but as you've noticed, the lighting is really harsh.

Greg McKaskle
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
Camera Color Tracking with Team 2859 Personality LightWaves1636 Programming 4 29-01-2009 21:03
Multiple Targets in "LabVIEW Sample two-color target tracking code" markulrich NI LabVIEW 7 29-01-2009 11:52
2009 Color Target: full vs. half circle. PhilBot Technical Discussion 0 08-01-2009 12:27
Camera Tracking Target Jade Programming 3 20-01-2007 01:41
Robot color issues. BerserkerSpyke General Forum 19 20-02-2005 17:06


All times are GMT -5. The time now is 06:13.

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