Yea. We decided to track the bottom target, but when we added multiple targets the camera would track the left and right targets not knowing what target to lock onto. With reports[i].imageHeight > minSquareHeight we were trying to find where the lowest target was. If I were to change report[i].imageHeight to boundingRectHeight will the camera be able to find the middle of the bottom target. Where would I get the BinaryImage.particleFilter(). I don't see it under the Binary Image class. How does it work and where would I put it in the code.
How would this work?
Code:
for (int i = 0; i < reports.length; i++) {
if (reports[i].boundingRectHeight > minSquareHeight && reports[i].center_mass_y > lowestSquare) {
lowestSquare = reports[i].center_mass_y;
lowSquareIndex = i;
System.out.println("Target: " + i + " " + reports[i].center_mass_x + "," + reports[i].center_mass_y);
}
}
Thanks again for your help.