NAME
walhad_transform - performs Walsh or Hadamard transform
SYNOPSIS
#include "CVIPtools.h"
#include "CVIPimage.h"
#include "CVIPdef.h"
#include <math.h>
#include "CVIPtransform.h"
Image *walhad_transform(Image *in_Image, int ibit, int
block_size)
<in_Image> - pointer to an Image structure
<ibit> - 0=inverse Walsh transform, 1=Walsh transform
2=inverse Hadamard transform, 3=Hadamard transform
<block_size> - block size (4,8,16,...largest_dimension/2)
PATH
$CVIPHOME/TRANSFORMS/walhad.c
DESCRIPTION
This function performs a fast Hadamard-ordered Walsh-
Hadamard Transform on an image. The result is then reor-
dered for display in sequency order. The routine works on
any image with dimensions that are powers of 2. Optional
zero-padding may be performed if input image has different
dimensions.
TYPES AND CONSTANTS
None
RETURN VALUES
A transformed image
HISTORY
History information recorded: None
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPconvert.h>
#include <CVIPview.h>
#include <CVIPtransform.h>
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile,*outputfile;
setDisplay_Image(VIEWER, "Default");
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 a forward walsh transform on
the input image with block size equal to 8 */
cvipImage = haar_transform(cvipImage, 1,8);
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);
}
SEE ALSO
libtransform
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh and Arve
Kjoelen.