NAME

     hist_thresh_segment - a thresholding-of-histogram  segmenta-
     tion technique

SYNOPSIS

      #include "CVIPtoolkit.h"
      #include "CVIPdef.h"
      #include "hist_thresh.h"

      Image *hist_thresh_segment(Image *imgP)

      <imgP> - pointer to Image structure

      Image *hist_thresh_gray(Image *imgP)

      <imgP> - pointer to Image structure

PATH

     $CVIPHOME/SEGMENTATION/hist_thresh.c

DESCRIPTION

     hist_thresh_gray  segments  a  grayscale   image   using   a
     thresholding-of-histogram  segmentation  technique  to split
     image regions recursively.  hist_thresh_segment is a  driver
     of  hist_thresh_gray.  Especially,  if  the  input  image is
     multi-band, hist_thresh_segment  first  uses  the  Principal
     Components  Transform  (PCT)  to map the maximum information
     into one image plane, then calls hist_thresh_gray.

TYPES AND CONSTANTS

     typedef struct {
          int  lower;
          int  peak;
          int  upper;
     } PeakObject;

RETURN VALUES

     Returns  Image  pointer  upon  successful  completion,   and
     returns NULL on failure.

EXAMPLE

      #include "CVIPtoolkit.h"
      #include "CVIPdef.h"
      #include "CVIPconvert.h"
      #include "hist_thresh.h"

           void main()
           {
           Image *cvipImage;
           IMAGE_FORMAT format;
           char *inputfile, *outputfile;

           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 = hist_thresh_segment(cvipImage);
           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

     libsegment

AUTHOR

     Copyright (C) 1995 SIUE - by Scott Umbaugh and Greg Hance.