[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();
}

 

posted @ 2019-10-13 16:47  Xu_Lin  阅读(970)  评论(0编辑  收藏  举报