1 | initial version |
I suggest using color thresholding (inRange() ) then get contours.
Now you want to filter unwanted contours right ?
1 -loop through all contours
2- calculate contour Area or Length
3- eliminate unwanted contours
for( int n = 0; n< contours.size(); n++ )
{
double Area = contourArea( contours[i],false);
if(condition)
contours.erase(contours[n]);
}
Hope it helps