fixed pointPolygonTest(). Now it returns -1, 0, 1 when measureDist=false (ticket #1285)

This commit is contained in:
Vadim Pisarevsky 2011-08-07 16:58:29 +00:00
parent 99e3b5a24e
commit e5c66b5ed4

View File

@ -169,7 +169,7 @@ cvPointPolygonTest( const CvArr* _contour, CvPoint2D32f pt, int measure_dist )
CvRect r = ((CvContour*)contour)->rect;
if( pt.x < r.x || pt.y < r.y ||
pt.x >= r.x + r.width || pt.y >= r.y + r.height )
return -100;
return -1;
}
}
else if( CV_IS_SEQ_CHAIN(contour) )
@ -214,7 +214,7 @@ cvPointPolygonTest( const CvArr* _contour, CvPoint2D32f pt, int measure_dist )
counter += dist > 0;
}
result = counter % 2 == 0 ? -100 : 100;
result = counter % 2 == 0 ? -1 : 1;
}
else
{
@ -265,7 +265,7 @@ cvPointPolygonTest( const CvArr* _contour, CvPoint2D32f pt, int measure_dist )
counter += dist > 0;
}
result = counter % 2 == 0 ? -100 : 100;
result = counter % 2 == 0 ? -1 : 1;
}
else
{