[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| FindAverage Class Template Reference |
--- | --- | ---

Find the average pixel value in an image or ROI. More...

`#include "vigra/inspectimage.hxx"`

## Public Types

typedef VALUETYPE | argument_type
typedef NumericTraits< VALUETYPE >::RealPromote | result_type
typedef NumericTraits< VALUETYPE >::RealPromote | value_type

## Public Methods

| FindAverage ()
void | reset ()
void | operator() (argument_type const &v)
void | operator() (FindAverage const &v)
result_type | average () const
result_type | operator() () const

## Detailed Description

### template<class VALUETYPE>
class vigra::FindAverage< VALUETYPE >

Find the average pixel value in an image or ROI.

In addition the size of the ROI is calculated. This Functor can also be used in conjunction with ArrayOfRegionStatistics to find the average of all regions in a labeled image.

Traits defined:

`FunctorTraits::isUnaryAnalyser` and `FunctorTraits::isInitializer` are true (`VigraTrueType`)``

Usage:

#include "vigra/inspectimage.hxx"
Namespace: vigra

        vigra::BImage img;

        vigra::FindAverage<vigra::BImage::PixelType> average;   // init functor

        vigra::inspectImage(srcImageRange(img), average);

        cout << "Average: " << average();

Required Interface:

        VALUETYPE v1, v2(v1);

        v1 < v2;
        v1 = v2;

## Member Typedef Documentation

typedef VALUETYPE argument_type

| the functor's argument type

typedef NumericTraits<VALUETYPE>::RealPromote result_type

| the functor's result type

typedef NumericTraits<VALUETYPE>::RealPromote value_type

Deprecated:
  use argument_type and result_type

## Constructor & Destructor Documentation

FindAverage | ( |  | ) | `[inline]`

| init average

## Member Function Documentation

result_type average | ( |  | ) | const`[inline]`

| return current average

result_type operator() | ( |  | ) | const`[inline]`

| return current average

void operator() | ( | FindAverage< VALUETYPE > const & | v | ) | `[inline]`

| merge two statistics

void operator() | ( | argument_type const & | v | ) | `[inline]`

| update average

void reset | ( |  | ) | `[inline]`

| (re-)init average

The documentation for this class was generated from the following file:

- vigra/inspectimage.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.4.0 (21 Dec 2005)