NAME
MorphClose_Image - performs morphological closing
SYNOPSIS
#include "CVIPimage.h"
#include "CVIPtoolkit.h"
#include "CVIPmatrix.h"
#include "CVIPmorph.h"
Image *MorphClose_Image(Image *inputImage, Matrix *kernelP,
CVIP_BOOLEAN user_org, int row, int col)
<inputImage> - a pointer to an Image structure
<kernelP> - a pointer to a Matrix structure
<user_org> - define center of kernel
<row> - user-defined row of kernel center
<col> - user-defined column of kernel center
Image* MorphClose(Image *inputImage, int k_type, int ksize,
int height, int width)
<inputImage> - pointer to an Input
<k_type> - kernel type (1=disk 2=square 3=rectangle
4=cross)
<ksize> - size of kernal (height and width of mask)
<height> - height for square and rectangle, thickness of
lines for cross
<width> - width for rectangle, size of cross
PATH
$CVIPHOME/MORPHOLOGICAL/morphCODE.c
DESCRIPTION
Morphologic closing consists of morphological dilation fol-
lowed by morphological erosion of an image. It is often used
to fill in small gaps or holes in objects.
TYPES AND CONSTANTS
None
RETURN VALUES
Returns a modified image.
HISTORY
History information recorded: None
EXAMPLE
#include <CVIPtoolkit.h>
#include <CVIPdef.h>
#include <CVIPimage.h>
#include <CVIPconvert.h>
#include <CVIPimage.h>
#include <CVIPmatrix.h>
#include <CVIPmorph.h>
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile, *outputfile;
(void) setDisplay_Image("RamViewer", "Default");
print_CVIP("\n\t\tEnter the Input File Name: ");
inputfile =(char *) getString_CVIP();
format = getFormat_CVIP(inputfile);
cvipImage = read_Image(inputfile, 1);
print_CVIP("\n");
cvipImage = (Image *)MorphClose(cvipImage,1,3,3,3);
fflush(stdin);
print_CVIP("\n\t\tEnter the Output File Name: ");
outputfile = getString_CVIP();
write_Image(cvipImage,
outputfile,CVIP_NO,CVIP_NO,format, 1);
display_Image(outputfile,format);
free(inputfile);
free(outputfile);
}
BUGS
None at this time
SEE ALSO
MorphDilate_Image, MorphErode_Image, MorphOpen_Image
AUTHOR
Copyright (C) 1996 SIUE - by Scott Umbaugh, Greg Hance, and
Kun Luo.