c++ - pointPolygonTest doesn't find any point -
c++ - pointPolygonTest doesn't find any point -
i want find center of palm. firstly,i found contours , select max area contour. , used pointpolygontest. code , result image below, didn't find point using pointpolygontest. problem?
double dist, maxdist = -1; point center; for(int = 0; i< drawing.cols; += 10) { for(int j = 0; j< drawing.rows; j += 10) { dist = pointpolygontest(contours[maxareaindex], point(i,j),true); cout << " dist " << dist << endl; if(dist > maxdist) { maxdist = dist; center = cv::point(i,j); } } } cout << "maxdist = " << maxdist << endl; circle(drawing, center, maxdist, cv::scalar(220,75,20),1,cv_aa); /// show in window namedwindow( "contours", cv_window_autosize ); imshow( "contours", drawing );
c++ opencv contour gestures convex-polygon
Comments
Post a Comment