Ask Your Question

removing small blob from image?

asked 2015-10-05 06:48:24 -0500

User1 gravatar image

updated 2015-10-05 06:49:26 -0500

I'm working on a java image processing program(based on OpenCV libraryJava). I need to remove the small regions from the image to get a clean image that contain only the large circle ?

image description

edit retag flag offensive close merge delete


have you tried to switch erode and dilate? What is the input image?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-10-05 06:54:35 -0500 )edit

You can also print blobs filtering by Size, you'll remove all the blobs standing alone

David_86 gravatar imageDavid_86 ( 2015-10-05 07:00:44 -0500 )edit

Yes I try Erode and Dilate But it does not work well ...

User1 gravatar imageUser1 ( 2015-10-05 07:09:13 -0500 )edit

U mean I need to use Filter by size to get rid of all small blobs ?! Could u please tell me the name of filter that can I use for this purpose ?

User1 gravatar imageUser1 ( 2015-10-05 07:11:22 -0500 )edit

Check this example, you can set parameters of the BlobDetector to filter smaller blobs. Maybe also the circularity could be usefull in your case, I can't tell without the original image

David_86 gravatar imageDavid_86 ( 2015-10-05 07:55:56 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-05 07:01:43 -0500

unxnut gravatar image

Looks like you should apply dilate, erode, erode, dilate to clean up the image. Then, you can use findcontours and eliminate contours with "small" area as well as any contours that touch the image borders. You may have to experiment a bit with the first part.

edit flag offensive delete link more



or closing followed by opening morphological operations more correctly :-)

theodore gravatar imagetheodore ( 2015-10-05 07:59:45 -0500 )edit

open followed by close give me better result :-) thank u a lot :)

User1 gravatar imageUser1 ( 2015-10-06 04:35:03 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-10-05 06:48:24 -0500

Seen: 1,776 times

Last updated: Oct 05 '15