OpenCV how to find a list of connected components in a binary image

前端 未结 2 1042
[愿得一人]
[愿得一人] 2020-12-14 20:32

I am using OpenCV for a C++ application. I have a 8 bit binary image that has some objects. The objects are all colored 255, whereas everything in the background is colored

相关标签:
2条回答
  • 2020-12-14 21:16

    You need to cv::floodFill the contours returned by cv::findCountours. See this example for findContours, and this one for floodFill

    0 讨论(0)
  • 2020-12-14 21:19

    Starting from version 3.0, OpenCV has connectedComponents function.

    0 讨论(0)
提交回复
热议问题