Page 2 of 2

Re: How to dilate foregrouned only if it's surrounded by background?

Posted: 2016-10-01T17:48:47-07:00
by nicolai.rostov
Yep, black and white, at least this is how the documentation makes me see what morphology (originally) sees as background and foreground.

On the other hand, doesn't IM already have a similar feature? How does the '-despeckle' operator decide what is, and what is not, a speckle? There must be a way to generalize this to other operations.

Re: How to dilate foreground only if it's surrounded by background?

Posted: 2016-10-01T18:24:39-07:00
by fmw42
From the code:


% DespeckleImage() reduces the speckle noise in an image while perserving the
% edges of the original image. A speckle removing filter uses a complementary
% hulling technique (raising pixels that are darker than their surrounding
% neighbors, then complementarily lowering pixels that are brighter than their
% surrounding neighbors) to reduce the speckle index of that image (reference
% Crimmins speckle removal).


So again simply looking at the graylevels of the neighborhood.

See effect.c at line 916