Ask Your Question
0

removing small blob from image?

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

User1 gravatar image

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

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

Comments

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

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-10-05 06:54:35 -0600 )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 -0600 )edit

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

User1 gravatar imageUser1 ( 2015-10-05 07:09:13 -0600 )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 -0600 )edit
1

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 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

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

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

Comments

2

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

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

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

User1 gravatar imageUser1 ( 2015-10-06 04:35:03 -0600 )edit

Question Tools

2 followers

Stats

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

Seen: 2,567 times

Last updated: Oct 05 '15