View Single Post
  #3   Spotlight this post!  
Unread 11-02-2012, 13:14
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Crash corse in image tracking!!

Well, the first thing you want to do is look into the sample camera project provided. (Ignore this if your vision guy already has some code done.)

In there, there is a line like so:
Code:
BinaryImage thresholdImage = image.thresholdRGB(25, 255, 0, 45, 0, 47);
What this does is to implement a threshold for colors (specifically, keeping the color red and ignoring everything else).

The parameters are:
1. Min R = 25
2. Max R = 255
3. Min G = 0
4. Max G = 45
5. Min B = 0
6. Max B = 47

These are standard RGB values. If you want to use a pure green LED instead of pure red, you would switch parameters 1~2 with 3~4.

For more information, I would suggest trying to read into and understanding the sample camera test file. Another place you should look into is the Javadoc files, particularly the entries concerning BinaryImage and ParticleAnalysisReport.
Reply With Quote