Go to Post This wins this week's award for "Most Bizarre Thread". Carry on. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-01-2013, 08:21
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
White Ring Light

My team has a white ring light up at the shop, but no green one. This is the first year that we are trying to get vision targeting working, so I was planning on just using the 2013 vision sample program and tweaking as little as possible. If we are using a white ring light, would changing the value of VALUE (HSV) so that it is a very high number, say 240-250, work to track the white rectangle that we will get? As I understood the vision processing paper, white is simply a very high value number.

I have also done some extensive testing on Microsoft Word with colored squares to see what range of values will return a "white" square. 240 - 250 is all pretty white.

Or, would we be better off getting some green LEDs and using those?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 28-01-2013, 09:05
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is offline
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,873
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: White Ring Light

I bought two of these today
http://www.superbrightleds.com/morei...ent-lights/49/

I purchased the 60mm. it fits nicely around the camera lens.
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #3   Spotlight this post!  
Unread 28-01-2013, 09:49
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: White Ring Light

HSL is a 3D color space as is RGB. RGB are generally viewed as a cube with a red, a blue, and a green axis. That puts black in the 0,0,0 corner and white in the 255,255,255 corner.

HSL has one circular component and two linear components, so it is pretty naturally thought of as a cylinder. But, the issue is that not all of those HSL values are really unique. If L is zero, the color is black, it doesn't matter what hue is, and saturation means nothing if there is nothing to blend with but black. So another visual that is more compact is to think of it as a snow cone with another paper cone put on top. This is really just taking all of the similar colors and shrinking them inwards so that the cylinder has been deformed to have a peaked top and bottom.

Anyway, when L is at an extreme, the other values really don't matter. Thus white light can have any hue, is by definition going to have a very low saturation, and will have an L that is almost 255. So, it is possible to use HSL to threshold, but since you really only care about L, it is generally faster and clearer to extract the L plane and do a monochrome threshold. It is even faster to ask the camera to simply give you a monochrome image, and you may have luck with that.

As for whether this is better than a green light, I'd say that it isn't better, but it may be good enough. If you have the time, I'd encourage you to experiment with both.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2013, 13:26
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
Re: White Ring Light

In the example code, how would you get it so that the camera sent in only a monchrome image, or the code would only analyze the L value?
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2013, 15:55
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: White Ring Light

I don't have the C++ example code in front of me. The WPILib camera should have a property called something like Color Enable.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2013, 11:57
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: White Ring Light

Quote:
Originally Posted by dmitch View Post
In the example code, how would you get it so that the camera sent in only a monchrome image, or the code would only analyze the L value?
In the code, there is something about the threshhold, in this line (This is what we changed it to to get a white light working):
Threshold threshold(0, 255, 0, 255, 240, 255);
Those numbers are MinHue, MaxHue, MinSaturation, MaxSaturation, MinLuminosity, MaxLuminosity. So just make the Hue and Sat. from 0-255, and the Lightness from 240-255.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage
Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2013, 22:49
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: White Ring Light

How i went about solving this problem is first converting the image to gray scale, so HSV has no importance. With OpenCV, the computer vision library I use, the part involving HSV can add to processing time, which is unfortunate for our frisbee tracker. When it is converted to gray scale, you can apply a threshold, and it will be a 1 channel deep threshold since gray scale is a 1 channel array, unlike hsv or rbg (which has 3 channels of arrays). You are correct in saying that the square will have a high value, but it will also have a high pixel value in gray scale, and would reduce the amount of memory needed since hue and saturation will not be needed. This process is also the same with using IR, and any other colour, just a matter of thresholding. Best of luck from team 1706.
Reply With Quote
  #8   Spotlight this post!  
Unread 06-02-2013, 08:12
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: White Ring Light

If you cannot get the camera to send a grayscale/monochrome image, then converting it to grayscale is the equivalent thing. This is the same as computing the V but not bothering with the H and S conversions. If you have enough contrast to find the shape, this is a good approach. The vast majority of industrial machine cameras are still monochrome.

Greg McKaskle
Reply With Quote
Reply


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


All times are GMT -5. The time now is 02:56.

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