For example, there are 9 region of interest. I need to remove those that are bigger than 1000 and smaller than 65. What is the best way to do it? I was using this method but it is not working.
double max_area=1000;
double min_area=65;
for( int i = 0; i< contours.size(); i++ )
{
double area=contourArea( contours[i],false);
if((area>max_area) || (area<min_area)) contours.erase(contours.begin()="" +="" i);="" }<="" p="">