[opencv]drawContours 示例
vector<vector<Point>> contours; vector<Vec4i> hierarchy; findContours(img_canny,contours,hierarchy,RETR_TREE,CHAIN_APPROX_SIMPLE); for (int i = 0; i < contours.size(); i++){ drawContours(img, contours, i, Scalar(0, 0, 255), 2, 8, hierarchy, 0, Point()); imshow("contours"/*+TempHelper::toString(i)*/, img); waitKey(); }
Talk is cheap. Show me the code