[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
|
FindSum [Functors To Inspect Images] |
![]() |
Find the sum of the pixel values in an image or ROI. More...
#include <vigra/inspectimage.hxx>
Inherits vigra::UnaryReduceFunctorTag.
Public Types | |
| typedef VALUETYPE | argument_type |
| typedef NumericTraits < VALUETYPE >::Promote | result_type |
Public Member Functions | |
| FindSum () | |
| result_type | operator() () const |
| void | operator() (FindSum const &v) |
| void | operator() (argument_type const &v) |
| void | reset () |
| result_type | sum () const |
This Functor can also be used in conjunction with ArrayOfRegionStatistics to find the sum of all regions in a labeled image, and with the reduce mode of transformMultiArray().
Traits defined:
FunctorTraits::isUnaryAnalyser and FunctorTraits::isInitializer are true (VigraTrueType)
Usage:
#include <vigra/inspectimage.hxx>
Namespace: vigra
vigra::BImage img; vigra::FindSum<vigra::BImage::PixelType> sum; // init functor vigra::inspectImage(srcImageRange(img), sum); cout << "Sum: " << sum();
Required Interface:
VALUETYPE v1, v2(v1);
v1 += v2;
| typedef VALUETYPE argument_type |
the functor's argument type
| typedef NumericTraits<VALUETYPE>::Promote result_type |
the functor's result type
| FindSum | ( | ) |
init sum
| result_type operator() | ( | ) | const |
return current sum
| void operator() | ( | FindSum< VALUETYPE > const & | v | ) |
merge two statistics
| void operator() | ( | argument_type const & | v | ) |
update sum
| void reset | ( | ) |
(re-)init sum
| result_type sum | ( | ) | const |
return current sum
|
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|