View Single Post
  #8   Spotlight this post!  
Unread 09-02-2014, 01:36
sailorjoe sailorjoe is offline
Mentor, RoboEagles, FWHS
AKA: Joe Hafner
FRC #4579 (RoboEagles)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Auburn, WA
Posts: 10
sailorjoe is an unknown quantity at this point
Re: Vision sample code

Hi, SparkyShires. Thresholding is a way to separate the bright areas from the not-so-bright areas of in image. Basically, any pixel value below the threshold is converted to completely dark, or black. For extra complexity, This happens in each of the three color planes, which is why the Thresholding method requires so many parameters. After thresholding, the image will have only a few areas of interest, which were the bright areas in the image before thresholding. These are called "particles". The vision code processes these particles to determine Hot or Not.

When I moved the sample code into my robot program, I had to change some things. I took a few statements used to initialize the camera out to a separate method. Then I changed the VisionAnalysis method from void to boolean, and had it return the HotOrNot decision with a return statement just above the catch statements. With the changes made, I copied the whole kit-and-kabootle into a Camera Subsystem, which I call from an Autonomous Command.
More work to do! Good luck.
Reply With Quote