1 | initial version |
Suppose you already found the contour,
Then using the code,
int min_area=500; // area threshold
for( int i = 0; i< contours.size(); i++ ) // iterate through each contour.
{
double area=contourArea( contours[i],false); // Find the area of contour
if(area<min_area)
contours.erase(contours.begin() + i);
}
you can iterate through contours and remove. I hope it will work.
2 | No.2 Revision |
Suppose you already found the contour, contours,
Then using the code,
int min_area=500; // area threshold
for( int i = 0; i< contours.size(); i++ ) // iterate through each contour.
{
double area=contourArea( contours[i],false); // Find the area of contour
if(area<min_area)
contours.erase(contours.begin() + i);
}
you can iterate through contours and remove. I hope it will work.
3 | No.3 Revision |
Suppose you already found contours,
Then using the code,
int double min_area=500; // area threshold
for( int i = 0; i< contours.size(); i++ ) // iterate through each contour.
{
double area=contourArea( contours[i],false); // Find the area of contour
if(area<min_area)
contours.erase(contours.begin() + i);
}
you can iterate through contours and remove. I hope it will work.