How to fill contours that touch the image border?
问题 Say I have the following binary image created from the output of cv::watershed() : Now I want to find and fill the contours, so I can separate the corresponding objects from the background in the original image (that was segmented by the watershed function). To segment the image and find the contours I use the code below: cv::Mat bgr = cv::imread("test.png"); // Some function that provides the rough outline for the segmented regions. cv::Mat markers = find_markers(bgr); cv::watershed(bgr,