View Single Post
  #3   Spotlight this post!  
Unread 23-02-2012, 18:02
questionsigotem questionsigotem is offline
Registered User
FRC #1647
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2009
Location: New Jersey
Posts: 14
questionsigotem is an unknown quantity at this point
Re: Tracking Multiple Targets

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.
Reply With Quote