18 #ifndef __otbJoinHistogramMI_h
19 #define __otbJoinHistogramMI_h
29 template<
class TInput1,
class TInput2,
class TOutput>
40 TOutput jointEntropy = itk::NumericTraits<TOutput>::Zero;
86 for (
unsigned long pos = 0; pos < itA.Size(); ++pos)
88 double valueA =
static_cast<double>(itA.GetPixel(pos));
89 double valueB =
static_cast<double>(itB.GetPixel(pos));
98 jointEntropy += freq * vcl_log(freq);
103 jointEntropy = -jointEntropy /
static_cast<TOutput
>(totalFreq) +
119 return static_cast<TOutput
>(0);