head	1.4;
access;
symbols;
locks; strict;
comment	@ * @;


1.4
date	95.01.04.06.16.12;	author rjj;	state Exp;
branches;
next	1.3;

1.3
date	94.10.14.04.13.25;	author rjj;	state Exp;
branches;
next	1.2;

1.2
date	94.06.23.04.12.40;	author rjj;	state Exp;
branches;
next	1.1;

1.1
date	94.06.22.17.17.27;	author rjj;	state Exp;
branches;
next	;


desc
@Initial version of the Otsu algorithm, with debug msgs intact.
@


1.4
log
@Deleted redundant line with name of section.
@
text
@// otsu-image.h         Section: 3.7
// Threshold Selection by Maximizing Between Class Variance
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
//
// This example utilizes the alternate formulation by defining
//      an image whose domain represents all possible partitions
//      of the input image, and whose value represents the
//      objective function to be maximized.
// This definition is not utilized directly by the user of the Otsu
//      function, but is utilized internally.

#ifndef otsu_image_h_
#define otsu_image_h_


#include "FloatDI.h"
#include "ClosureI.h"


////////////////////////////////////////////////////////////////////////
// class OtsuImage
//   This class represents an image with the following properties:
//   1) It data is derived from some original image: a
//   2) Its domain is a function of  a.range() and the number of
//      partitions the histogram(a) is to be broken into.
//   3) Its range values are determined by the objective function
//      described in the IAH for the Otsu algorithm.
//
class  OtsuImage: public IA_ClosureI<IA_Point<int>,float> {

private:
    unsigned int d;                // Number of Tau points == our dimension
    double       total_mu_squared; // Square of total mean value of nh
    IA_Image<IA_Point<int>,float>
        nh,      // normalized histogram of a
	cnh,     // cumulative normalized histogram of a
	mu_cnh;  // cumulative normalized area histogram of a
    IA_Point<int> minNHpt, maxNHpt;
public:
    OtsuImage(unsigned int tauCount,
		 IA_Image<IA_Point<int>,float> normalizedHistogram );

    float operator() (const IA_Point<int> &loop_ip) const;

    IA_ClosureI<IA_Point<int>,float> * clone_self() const;

    ostream & print_this(ostream & os) const;
};

#endif
@


1.3
log
@Added algorithm to standard header.  Comment and style changes.
@
text
@d5 1
a5 1
// Threshold Selection by Maximizing Between Class Variance
@


1.2
log
@First version of Otsu without debug stmts.  Seems to work, however the
  closure still had problems, it generates spurious iac++ instantiations.
@
text
@d2 1
d38 1
a38 1
	mu_cnh;  // cumultaive normalized area histogram of a
@


1.1
log
@Initial revision
@
text
@d5 6
a10 1
// This example utilizes the alternate formulation.
@
