I use a for loop to sort out all but the largest area item in the array. This is usually going to be the target if you are pointing the right way. Also using a filter contours pipe in GRIP may give you what you want.
EDIT:
Code:
public boolean isContours() {
Robot.table.getNumberArray("area", greenAreasArray);
if (greenAreasArray.length > 1) {
return true;
} else {
return false;
}
}
public void findMaxArea() {
if (isContours()) {
for (int counter = 0; counter < greenAreasArray.length; counter++) {
if (greenAreasArray[counter] > maxArea) {
maxArea = greenAreasArray[counter];
arrayNum = counter;
}
}
System.out.println(maxArea);
}
}