Merge pull request #12206 from jsxyhelu/3.4

find innercircle of contour by using pointPolygonTest: (#12206)
This commit is contained in:
jsxyhelu
2018-09-12 04:58:01 +08:00
committed by Alexander Alekhin
parent 492ef14550
commit 7828854c9d
4 changed files with 9 additions and 5 deletions
@@ -50,7 +50,8 @@ int main( void )
}
double minVal, maxVal;
minMaxLoc( raw_dist, &minVal, &maxVal );
Point maxDistPt; // inscribed circle center
minMaxLoc(raw_dist, &minVal, &maxVal, NULL, &maxDistPt);
minVal = abs(minVal);
maxVal = abs(maxVal);
@@ -76,10 +77,11 @@ int main( void )
}
}
}
circle(drawing, maxDistPt, (int)maxVal, Scalar(255,255,255));
/// Show your results
imshow( "Source", src );
imshow( "Distance", drawing );
imshow( "Distance and inscribed circle", drawing );
waitKey();
return 0;