4
$\begingroup$

I am finding the techniques to remove unwanted regions (small dots) from image. I have an image that includes object and some unwanted region (small dots- see first image). I want to remove it. Hence, I use some morphological operator example 'close' to remove. But it is not perfect. Do you have other way to remove more clear (similar second image)? You can download example image at here

enter image description here

enter image description here

$\endgroup$
  • $\begingroup$ can you try opening ; erosion (to remove unwanted areas) followed by dilation (to restore the wanted area to its original size). $\endgroup$ – keen marozva Jun 6 '17 at 18:30
2
$\begingroup$

Looks like you are using Matlab. Try bwareaopen(I, N), where I is the original binary image and N is the estimated size of each unwanted connected region.

You can try edit bwareaopen for more details. Basically the algorithm tries to find the size of connected regions. Connected-component labeling with union-find algorithm is expected to get you there.

$\endgroup$
  • $\begingroup$ @lenon310: Thank you so mục .You ar right. But I want to refer one method (not function).Do you know which is method $\endgroup$ – John Mar 25 '14 at 13:47
  • $\begingroup$ @user8264 Some links added for your reference. Thanks $\endgroup$ – lennon310 Mar 25 '14 at 13:52
2
$\begingroup$

Referring to MATLAB, the basic steps are

Determine the connected components:

CC = bwconncomp(BW, conn);

Compute the area of each component:

S = regionprops(CC, 'Area');

Remove small objects:

L = labelmatrix(CC); BW2 = ismember(L, find([S.Area] >= P));

At the last step, after obtaining $L$, you might as well retain the component with the largest area if you are interested in a single component. This would make the algorithm invariant to the size of the noise.

$\endgroup$
0
$\begingroup$

You could try to apply anisotropic filtering as described by Perona and Malik (and many papers after that).

I would go in two steps: -first step low pass filter of your image, likely the unwanted region will be smoothed out, but the good region will be a bit blurred. -second step apply a diffusion a la perona and malik and use the first step to speed/slow diffusion depending you are in the good region (with data left) or a bad one (filtered out).

That is however if you are ok with obtaining a greyscale image, if you want to keep it binary it would not work I guess.

$\endgroup$
  • $\begingroup$ I implement it but its result shows not good. $\endgroup$ – John Mar 25 '14 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.