opencv_tutorial_code学习——canny边缘检测后findContours

tutorial_code\ShapeDescriptors\findContours_demo.cpp

步骤:

1、灰度化

2、滤波

3、canny边缘检测

4、findContours(canny_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );

5、

Mat drawing = Mat::zeros( canny_output.size(), CV_8UC3 );
  for( size_t i = 0; i< contours.size(); i++ )
     {
       Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
       drawContours( drawing, contours, (int)i, color, 0.5, 8, hierarchy, 0, Point() );
     }


opencv里findcontours函数中hierarchy的意义:http://blog.csdn.net/a380331382/article/details/64132250

你可能感兴趣的:(opencv,opencv)