IM: Morphology Operations for Binary Images

IM - An Imaging Tool

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.

im.ProcessBinMorphConvolve(src_image: imImage, dst_image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphConvolveNew(image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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.

im.ProcessBinMorphErode(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphErodeNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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.

im.ProcessBinMorphDilate(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphDilateNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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+...

im.ProcessBinMorphOpen(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphOpenNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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

Dilate+Erode.

im.ProcessBinMorphClose(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphCloseNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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.

im.ProcessBinMorphOutline(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] 
im.ProcessBinMorphOutlineNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] 

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

im.ProcessBinMorphThin(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessBinMorphThinNew(image: imImage) -> new_image: imImage [in Lua 5]