// file: $USFS/class/image_analysis/v6.0/imaga_diff_10.cc
//

// isip include files
//
#include "image_analysis.h"
#include <integral_constants.h>

// method: dent_normalize_cc
//
// arguments: none
//
// return: a logical_1 value indicating status
//
// this method normalizes a histogram
//
logical_1 Image_analysis::dent_normalize_cc() {
  
  if (check_segflag_cc() == ISIP_TRUE) {

    // if no region corresponding to the transcription was found in the
    // image, no computation needed
    //
    if (polygon_list_d == (Link_list*)NULL) {
      return ISIP_TRUE;
    }
    else if ((polygon_list_d->get_head_cc()) == (Link_node*)NULL) {
      return ISIP_TRUE;
    }
  }

  if (dent_r_npxls_d != (int_4)0) {

    // declare a scaling constant
    //
    float_8 scale = 1.0 / (float_8)dent_r_npxls_d;
  
    // normalize
    //
    dent_t_sumred_d *= scale;
    dent_t_sumgrn_d *= scale;
    dent_t_sumblu_d *= scale;
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}



