Soroosh Khoram
Soroosh Khoram

Reputation: 517

remove all of a contour from image

I need to remove small parts from a binary image. So I find its contours by findContour. Then I find the area of each contour by contourArea. Is there a function that paints all pixels on boundaries and within those contours?

Upvotes: 0

Views: 1230

Answers (2)

FvD
FvD

Reputation: 1365

Or, rather, since you're using the OpenCV 2.x API:
drawContours(image, contours, contourIdx, Scalar(255,255,255))

See the documentation for more info.

Upvotes: 1

Boyko Perfanov
Boyko Perfanov

Reputation: 3047

cvDrawContours( image, contour, 255, 255, 0, CV_FILLED );

Upvotes: 3

Related Questions