Is there a way I can remove these unwanted parts in a grayscale image?

asked 2018-12-27 01:47:42 -0500

XTSR gravatar image

Hello, I am a beginner in OpenCV and I am trying to segment an image. I got it by getting the largest contour in the canny image and then I used the x, y, w, h of the boundingRect() to the original image then I turn the ROI into grayscale but the problem is other images resulted having these unwanted parts (the ones in green lines) touch the ROI.


image with noise

How can I remove those kind of noises?

Here is the image:

image description

edit retag flag offensive close merge delete


Try threshold method tutorial is here

LBerger gravatar imageLBerger ( 2018-12-27 03:42:52 -0500 )edit