Go to Post If an alternate is used, all four teams are equal members of the alliance. (Trophies, trips, bling, book tours, custody of the children etc.) - Btower [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 20-03-2016, 22:15
UnTrustedTruss UnTrustedTruss is offline
Local Nutter
no team
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 1492
Location: oz
Posts: 18
UnTrustedTruss will become famous soon enough
Help with GRIP HSL values?

Hi all - I'm trying to follow the 2016 GRIP tutorial for vision processing can't seem to nail the HSL values and as such am not able to target in certain situations. See Below:
  #2   Spotlight this post!  
Unread 20-03-2016, 22:21
Rangel(kf7fdb)'s Avatar
Rangel(kf7fdb) Rangel(kf7fdb) is offline
John Rangel
FRC #0842 (Falcon Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Phoenix, AZ
Posts: 725
Rangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond repute
Re: Help with GRIP HSL values?

Typically you want the HSL value to be filtering out as much as you can without removing any of the target. In the picture you have, some of the target is blacked out so your HSL values are too narrow. Try widening it and then maybe add filters to the minimum width to get ride of noise that remains.
__________________
2012 Dean's List Winner
2011-2014 Arizona Regional Winners
2016 Las Vegas Regional Winner
2014-? Mentor


  #3   Spotlight this post!  
Unread 20-03-2016, 23:08
UnTrustedTruss UnTrustedTruss is offline
Local Nutter
no team
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 1492
Location: oz
Posts: 18
UnTrustedTruss will become famous soon enough
Re: Help with GRIP HSL values?

Quote:
Originally Posted by Rangel(kf7fdb) View Post
Typically you want the HSL value to be filtering out as much as you can without removing any of the target. In the picture you have, some of the target is blacked out so your HSL values are too narrow. Try widening it and then maybe add filters to the minimum width to get ride of noise that remains.
Do you happen to have an example of a workflow that would correct this? I've widened my ranges and it's helped a little. What do you mean by adding filters to minimum width?
  #4   Spotlight this post!  
Unread 21-03-2016, 08:15
ghead ghead is offline
Registered User
FRC #3103
 
Join Date: Aug 2013
Location: US
Posts: 13
ghead is an unknown quantity at this point
Re: Help with GRIP HSL values?

On the "Filter Contours" module there are settings for "Min Width" and "Min Height". Once you open up your ranges to include all your target, try increasing the values in those filters to get rid of all the noise.
  #5   Spotlight this post!  
Unread 21-03-2016, 09:02
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Help with GRIP HSL values?

Protip
  1. Download Paint.net (PDN)
  2. Take a screenshot of the camera image
  3. Paste it into PDN
  4. Use the dropper tool on the target you want to select
  5. Select "Advanced" on the color palette
  6. The HSV values will be there for you to play with. Plug the HSV for that pixel in, +- 10-15 degrees depending on how much variance the image has.

E/ my bad couldnt see that image... his exposure seems incredibly low anyway
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)

Last edited by Arhowk : 21-03-2016 at 12:58.
  #6   Spotlight this post!  
Unread 21-03-2016, 11:45
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Help with GRIP HSL values?

Your vision target is overexposed in this image. Notice how the green washes out to white on the target on the right. This happens because there are blue (and even a small amount of red) components to the light emitted by your green LED ring, and you are saturating the green subpixels on your imager.

Digital cameras work by having an array of subpixels that measure light levels for a particular frequency band of light and location on the imaging plane. Each subpixel on your camera measures red, green, or blue light separately, and then nearby subpixels are combined to give RGB values to the final image. The problem is that each subpixel can only measure so little (ex. 0) or so much (ex. 255) light in a given part of the spectrum. You can manipulate the exposure time of the camera to affect how much light hits the sensor in total. Note that brightness/gain is NOT the same thing as exposure time - exposure time affects how much light can hit the sensor, while gain/brightness effectively multiply that amount of light by a constant.

If your LED light emits 90% green light, 9% blue light, and 1% red light (totally made up numbers), imagine what happens at different exposure times. At one exposure time, you might measure R=1, G=90, B=9.

This is decisively green and easy to segment in HSL/HSV (even though it is fairly dark). At another exposure time, R=10, G=900 (but gets capped at 255 by your sensor), B=90.

This is now slightly more blue looking, but still pretty green. At another exposure time, R=100, G=9000 (capped at 255), B=900 (capped at 255).

Now this is azure. At another exposure time, R=1000 (capped at 255), G=90000 (capped at 255), B=9000 (capped at 255).

This is white, and obviously bad for segmentation.

I would try to fix this before worrying about color thresholding (most USB or Ethernet cameras allow you to fix the exposure time one way or another). Once you get a consistent, non-saturated color in your image, thresholding becomes much easier (because the range of hues that you are interested in becomes very narrow).
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


All times are GMT -5. The time now is 04:59.

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