Crop/approximate contours
I have a contours like this: And I'm looking for a solution on how to cut the contours along the red line.
DoesOpenCV have a function for approximating contours that could do this?
I know that approxPolyDP not suitable for this.
Also I know that I can use for this opening morphological operation.
Also write if you know for sure that there is no such functionality in OpenCV, or you can advise the algorithm that can do it, or in general another library for work with contours.
Thanks.
You can try taking a look into the Opening functionality (https://docs.opencv.org/trunk/d9/d61/...)
Thanks, but I look for contours (set of point) algo, not images.
A few erodes followed by some dilates will coarsen the contour.
I can merely do on python by using mousevent and then draw and crop it. It will be easier to translated to c++
@Der Luftmensch. Thanks. It named
opening
morphological operation. I mentioned about it. @supra56. Thanks, but no need. I'm looking for an algorithm to work with arrays of contour points.