head	1.2;
access;
symbols;
locks; strict;
comment	@// @;


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

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


desc
@Template version of the histogram algorithm.
@


1.2
log
@Added standard header, corrected some spelling errors
@
text
@// histogram.h          Section: 9.3 Histogram & 9.4 Cumulative Histogram
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
//
// Calculate the histogram of an image using the template approach

#ifndef IA_Histogram_h_
#define IA_Histogram_h_

#include "Image.h"

//////////////////////////////////////////////////////////////////
// Note that the template formal parameter is expected to be
//   of the form: IA_Image<P,T>,
//   where P == IA_Point<int>   and
//         T == an image range type
//
template <class I>
IA_Image<IA_Point<int>,int>
histogram( const I & a );


template <class I>
IA_Image<IA_Point<int>,int>
cumulative_histogram( const I & a );



//////////////////////////////////////////////////////////////////
// normalized_histogram()
//   Return the normalized histogram of an image
//
template <class I>
IA_Image<IA_Point<int>,float>
normalized_histogram(const I &a) {

    return
	IA_Image<IA_Point<int>,float>( histogram(a) )
	/ a.domain().card();
}



//////////////////////////////////////////////////////////////////
// normalized_cumulative_histogram()
//   Return the normalized cumulative histogram of an image
//
template <class I>
IA_Image<IA_Point<int>,float>
normalized_cumulative_histogram(const I &a) {

    return
	IA_Image<IA_Point<int>,float>( cumulative_histogram(a) )
	/ a.domain().card();
}

#endif
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// histogram.h          Section: 9.3 & 9.4
d12 1
a12 1

d31 1
a31 1
//   Return the normailzed histogram of an image
d46 1
a46 1
//   Return the normailzed cumulative histogram of an image
@
