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

Threshold< SrcValueType, DestValueType > Class Template Reference

Threshold an image. More...

`#include <vigra/transformimage.hxx>`

## Public Types

typedef SrcValueType | argument_type
typedef DestValueType | result_type

## Public Member Functions

result_type | operator() (argument_type s) const
| Threshold (argument_type lower, argument_type higher, result_type noresult, result_type yesresult)

## Detailed Description

template<class SrcValueType, class DestValueType>
class vigra::Threshold< SrcValueType, DestValueType >

Threshold an image.

Note: Nowadays, it is probably easier to perform thresholding by means of C++ 11 lambda functions or array expressions.

If a source pixel is above or equal the lower and below or equal the higher threshold (i.e. within the closed interval [lower, higher]) the destination pixel is set to 'yesresult', otherwise to 'noresult'.

Traits defined:

`FunctorTraits::isUnaryFunctor` is true (`VigraTrueType`)

Usage:

#include <vigra/transformimage.hxx>
Namespace: vigra

vigra::BImage src(width, height), dest(width, height);
...
vigra::transformImage(src.upperLeft(), src.lowerRight(), src.accessor(),
dest.upperLeft(), dest.accessor(),
vigra::Threshold<
vigra::BImage::PixelType, vigra::BImage::PixelType>(10, 100, 0, 255));
vigra::RGBValue
Class for a single RGB value.
Definition rgbvalue.hxx:128
vigra::Threshold
Threshold an image.
Definition transformimage.hxx:984

Required Interface:

SrcValueType src;
DestValueType dest, yesresult, noresult;
dest = ((src < lower) || (higher < src)) ? noresult : yesresult;

## Member Typedef Documentation

## ◆ argument_type

template<class SrcValueType , class DestValueType >

typedef SrcValueType argument_type

the functor's argument type

## ◆ result_type

template<class SrcValueType , class DestValueType >

typedef DestValueType result_type

the functor's result type

## Constructor & Destructor Documentation

## ◆ Threshold()

template<class SrcValueType , class DestValueType >

Threshold | ( | argument_type | lower,
|  | argument_type | higher,
|  | result_type | noresult,
|  | result_type | yesresult
| ) |  |

init thresholds and return values

## Member Function Documentation

## ◆ operator()()

template<class SrcValueType , class DestValueType >

result_type operator() | ( | argument_type | s | ) | const

calculate transform

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

- vigra/transformimage.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.12.1