connected components in OpenCV

前端 未结 6 2058
既然无缘
既然无缘 2020-11-27 04:58

I am looking for an OpenCV function that can find connected components and perform a few tasks on them ( like getting the number of pixels, contour, list of pixels in the ob

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 05:46

    Have a look at the cvFindContours function. It's very versatile -- it can find both interior and exterior contours, and return the results in a variety of formats (e.g. flat list vs. tree structure). Once you have the contours, functions like cvContourArea allow you to determine basic properties of the connected component corresponding to a particular contour.

    If you prefer to use the newer C++ interface (as opposed to the older C-style interface I described above), then the function names are similar.

提交回复
热议问题