View Single Post
  #8   Spotlight this post!  
Unread Today, 12:02
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 18
ryan.mitchell is an unknown quantity at this point
Re: HSV Value Of Green from Reflectant Tape

Quote:
Originally Posted by jcbaker4050 View Post
GRIP will do this; however, the gotcha is that you'll need your source to be set to the same exposure that your camera will be when running on your RPi.

Team 4050 is new to vision this year, but what we've got so far seems to work reasonably well. We're using Java and OpenCV.

We wrote a basic program to run on a laptop that turns down the camera exposure (we used -10.0 for our Lifecam) and displays the webcam output to a JFrame. We used Alt-PrtScn hotkey to grab a shot of the window and then pasted it into Paint.NET as a new image. Crop out the window border and save it, and you've got a sample image to bring into GRIP. We did this for different distances and orientations to the gear lift.

Fire up GRIP, select the images as your source, and add the HSV Threshold operation to your pipeline. Adjust the HSV sliders to isolate the reflective tape as much as possible without too much degradation to the tape. At this point, you could simply record the start and end values of each of the sliders to get the HSV values that you'd want to use in your code.

Of course, you'd want to test in a real-world setting and probably make tweaks to the values, but the process I described should get you pretty close from the outset.

What we did was to build a full pipeline to do blurring, thresholding, eroding, and contour finding and then had GRIP generate the Java class for the pipeline (Tools > Generate Code).
Awesome, ill give it a go!
Reply With Quote