NAME
pct - performs the principal components transform.
SYNOPSIS
#include <pct.h>
cc ...libcolor.a
Image *pct(Image *imgP, CVIP_BOOLEAN is_mask, float *maskP)
<imgP> - pointer to Image structure
<is_mask> - whether to ignore a background color (CVIP_YES
or CVIP_NO)
<maskP> - background color to ignore
Image *ipct(Image *imgP, CVIP_BOOLEAN is_mask, float *maskP)
<imgP> - pointer to Image structure
<is_mask> - whether to ignore a background color (CVIP_YES
or CVIP_NO)
<maskP> - background color to ignore
Image *pct_color(Image *imgP, CVIP_BOOLEAN is_mask, float
*maskP, int choice)
<imgP> - pointer to Image structure
<is_mask> - whether to ignore a background color (CVIP_YES
or CVIP_NO)
<maskP> - background color to ignore
<choice> - 1=perform PCT, 2=perform IPCT
PATH
$CVIPHOME/COLOR/pct.c
DESCRIPTION
Performs the prinicipal components transform (PCT) on
<srcImage>. The resultant image contains a set of decorre-
lated data bands in which the first band is the most
discriminant, then the second band, and so on.
TYPES AND CONSTANTS
-
RETURN VALUES
Pointer to transformed image of type float
HISTORY
History information recorded: 9 variables, each an element
of the transformation matrix
EXAMPLE
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPdef.h>
#include <CVIPview.h>
#include <CVIPconvert.h>
#include <CVIPcomplex.h>
#include <CVIPcolor.h>
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile,*outputfile;
setDisplay_Image(VIEWER, "Default");
/* The input image should be a COLOR one */
print_CVIP("\n\t\tEnter the Input File Name: ");
inputfile =(char *) getString_CVIP();
format = getFormat_CVIP(inputfile);
cvipImage = read_Image(inputfile,1);
view_Image(cvipImage, inputfile);
free(inputfile);
/* the following call performs the forward principal com-
ponent
transform and the background color is not ignored */
cvipImage=pct_color(cvipImage,CVIP_NO,NULL,1);
print_CVIP("\n\t\tEnter the Output File Name: ");
outputfile = getString_CVIP();
view_Image(cvipImage,outputfile);
write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1);
free(outputfile);
}
BUGS
None at this time
SEE ALSO
libcolor
AUTHOR
Copyright (C) 1995 SIUE - by Scott Umbaugh and Greg Hance.