remove_ghost
[ XITE Reference Manual | XITE home ]
Name
remove_ghost, remove_inv_ghost, mark_ghost,
mark_inv_ghost - remove (or mark) "ghost" objects from
(or in) binary image
Syntax
#include <xite/binarize.h>
int remove_ghost( IBAND segmented,
IBAND original, IBAND outband,
int val_step_threshold );
int remove_inv_ghost( IBAND segmented,
IBAND original, IBAND outband,
int val_step_threshold );
int mark_ghost( IBAND segmented,
IBAND original, IBAND outband,
int val_step_threshold );
int mark_inv_ghost( IBAND segmented,
IBAND original, IBAND outband,
int val_step_threshold );
Description
The original gray scale image original and a binarized
version segmented are input to the routine.
-
remove_ghost
- First, inband is copied to outband. For all 4-connected
black objects in outband, the average gradient magnitude
value at the edge of the object is calculated. Objects having
an average gradient below the threshold value
val_step_threshold are removed from outband.
-
remove_inv_ghost
- Works like remove_ghost on 4-connected white objects.
-
mark_ghost
- Works like remove_ghost , but instead of removing an object,
it is colored (255 - avg_grad), where avg_grad is the
average gradient value on the edge of the object. It can then
be thresholded manually to give the final binary image.
-
mark_inv_ghost
- Combination of mark_ghost and remove_inv_ghost. Works like
remove_inv_ghost , but instead of removing an object, it is
colored avg_grad, where avg_grad is the average gradient
value on the edge of the object.
Restrictions
Works on unsigned byte bands.
Return value
0 : ok
1 : Bad pixel type for segmented
2 : Bad pixel type for original
3 : Bad pixel type for outband
See also
binarize(1), bin_yb(3), bin_iwr(3)
References
-
S.D. Yanowitz & A.M. Bruckstein
- "A New Method for Image Segmentation",
Comput. Vision Graphics Image Proc., vol 46, no 1, pp 82-95,
April 1989.
Files
src/binarize/remove_ghost.c
Author
Řivind Due Trier
Id
$Id: remove_ghost.c,v 1.18 1997/01/29 10:37:42 svein Exp $