std::vector>::iterator itc = contours.begin();
// for all contours
int cntCheck = 0;
while (itc != contours.end())
{
// verify contour size
size_t contourSize = itc->size();
if ((contourSize > 30) && (contourSize < 600))
{
++itc;
cntCheck = cntCheck + 1;
}
else
{
itc = contours.erase(itc);
}
}
This code is removing the contour that wrong size
This was code for normal operation in visual studio 2013.
but
This does not work in visual studio 2015.
When less than 30 works well. But an error is greater than 600.
How do i fix this?
thanks for reading.

↧