image = camera.getImage();
} catch (AxisCameraException ex) {
} catch (NIVisionException ex) {
}
BinaryImage thresholdImage = image.thresholdHSL(0, 255, 0, 31, 229, 255); // keep only red objects
BinaryImage bigObjectsImage = thresholdImage.removeSmallObjects(false, 2); // remove small artifacts
BinaryImage convexHullImage = bigObjectsImage.convexHull(false); // fill in occluded rectangles
BinaryImage filteredImage = convexHullImage.particleFilter(cc); // find filled in rectangles
ParticleAnalysisReport[] reports = filteredImage.getOrderedParticleAnalysisReports(); // get list of results