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.