## NAME

         local_histeq - performs histogram equalization on  block-by-
         block basis

## SYNOPSIS

          #include <stdio.h>
          #include "CVIPimage.h"
          #include "CVIPdef.h"
          #include "CVIPcolor.h"
          #include "CVIPhisto.h"

         Image *local_histeq(Image *in, int size, int mb)

          <in> - pointer to an Image structure
          <size> - desired blocksize
          <mb> - RGB band on which to calculate histogram (0,1,2)

## PATH

          $CVIPHOME/HISTOGRAM/local_histeq.c

## DESCRIPTION

         This function performs histogram equalization on local areas
         of  an  image  rather than on the image as a whole. The user
         may specify the size of blocks to use. By  performing  local
         rather  than  global histeq, detail can often be enhanced in
         large uniform areas of an image.

         The function will  remap  any  CVIP_INTEGER,  CVIP_FLOAT  or
         CVIP_DOUBLE  image  into CVIP_SHORT. It operates directly on
         images of type CVIP_SHORT and CVIP_BYTE.

## TYPES AND CONSTANTS

         None

## RETURN VALUES

         A histogram-equalized image.

## HISTORY

         History information recorded: None

## EXAMPLE

          #include <CVIPtoolkit.h>
          #include <CVIPdef.h>
          #include <CVIPimage.h>
          #include <CVIPconvert.h>
          #include "CVIPcolor.h"
          #include "CVIPhisto.h"

          void main()
          {
          Image *cvipImage;
          IMAGE_FORMAT format;
          char *inputfile, *outputfile;
          int rows, cols;
          setDisplay_Image("picture", "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);

          cvipImage =(Image *) local_histeq(cvipImage,16,0);
          cvipImage=remap_Image(cvipImage,CVIP_BYTE,0,255);

          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(inputfile);
          free(outputfile);
          }

## BUGS

         None at this time

## SEE ALSO

## AUTHOR

         Copyright (C) 1996 SIUE - by Scott Umbaugh and Arve Kjoelen.