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.
How to dilate foreground only if it's surrounded by background?
-
- Posts: 18
- Joined: 2015-10-06T10:42:17-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to dilate foreground only if it's surrounded by background?
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
% 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