21 #ifndef otbMeanFilterFunctor_h
22 #define otbMeanFilterFunctor_h
24 #include "itkNumericTraits.h"
42 template<
class TInput1,
class TOutput>
50 TOutput meanA=
static_cast<TOutput
>(0.0);
54 int non_zeros_pixels = 0;
55 for (
unsigned long pos = 0; pos < itA.Size(); ++pos)
57 if (itA.GetPixel(pos)[0]!=0.)
59 meanA[0] += itA.GetPixel(pos)[0];
64 if (non_zeros_pixels > 0)
75 TOutput ratio=itA.GetCenterPixel();
81 return static_cast<TOutput
>(ratio);