View Single Post
  #2   Spotlight this post!  
Unread 19-01-2012, 14:22
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Target tracking in Java

The basic workflow of processing an image using the NI functions is like this:

Get image -> Threshold to binary image -> get particle analysis reports -> pick out particles that look like rectangles

So, the next step for you would be to change your code to something like this

Code:
ColorImage image = AxisCamera.getInstance().getImage();
BinaryImage binaryImage = image.thresholdHSL(hueLow, hueHigh, saturationLow, saturationHigh, luminenceLow, luminenceHigh);
This will let you store the binary image that the thresholding creates. From there, you can call the getOrderedParticleAnalysisReports function to get the particle analysis reports, and go from there. One thing I did to make it easier was to write the images to the CRIO memory, then FTP in and look at them to make sure my thresholds are good. Each image has a write function, which takes the filename (with extension) as an argument.
Reply With Quote