IM: Morphology Operations for Binary Images

IM - Imaging Libray

Morphology Operations for Binary Images
[Image Processing]


Detailed Description

See im_process_loc.h


Functions

int imProcessBinMorphConvolve (const imImage *src_image, imImage *dst_image, const imImage *kernel, int hit_white, int iter)
int imProcessBinMorphErode (const imImage *src_image, imImage *dst_image, int kernel_size, int iter)
int imProcessBinMorphDilate (const imImage *src_image, imImage *dst_image, int kernel_size, int iter)
int imProcessBinMorphOpen (const imImage *src_image, imImage *dst_image, int kernel_size, int iter)
int imProcessBinMorphClose (const imImage *src_image, imImage *dst_image, int kernel_size, int iter)
int imProcessBinMorphOutline (const imImage *src_image, imImage *dst_image, int kernel_size, int iter)
void imProcessBinMorphThin (const imImage *src_image, imImage *dst_image)

Function Documentation

int imProcessBinMorphConvolve const imImage src_image,
imImage dst_image,
const imImage kernel,
int  hit_white,
int  iter
 

Base binary morphology convolution.
Images are all IM_BINARY. Kernel is IM_INT. Use kernel size odd for better results.
Hit white means hit=1 and miss=0, or else hit=0 and miss=1.
Use -1 for don't care positions in kernel.
The operation can be repeated by a number of iterations. The border is zero extended.
Almost all the binary morphology operations use this function.
If the kernel image attribute "Description" exists it is used by the counter.

int imProcessBinMorphErode const imImage src_image,
imImage dst_image,
int  kernel_size,
int  iter
 

Binary morphology convolution with a kernel full of "1"s and hit white.

int imProcessBinMorphDilate const imImage src_image,
imImage dst_image,
int  kernel_size,
int  iter
 

Binary morphology convolution with a kernel full of "0"s and hit black.

int imProcessBinMorphOpen const imImage src_image,
imImage dst_image,
int  kernel_size,
int  iter
 

Erode+Dilate. When iteration is more than one it means Erode+Erode+Erode+...+Dilate+Dilate+Dilate+...

int imProcessBinMorphClose const imImage src_image,
imImage dst_image,
int  kernel_size,
int  iter
 

Dilate+Erode.

int imProcessBinMorphOutline const imImage src_image,
imImage dst_image,
int  kernel_size,
int  iter
 

Erode+Difference.
The difference from the source image is applied only once.

void imProcessBinMorphThin const imImage src_image,
imImage dst_image
 

Thins the supplied binary image using Rosenfeld's parallel thinning algorithm.
Reference:
"Efficient Binary Image Thinning using Neighborhood Maps"
by Joseph M. Cychosz, [email protected]
in "Graphics Gems IV", Academic Press, 1994