Into

Modules

Documentation

classPiiImage::ThresholdFunction

#include <PiiThresholding.h>

ThresholdFunction compares two values and outputs either 0 or 1 based on the comparison result.

Inherits Pii::BinaryFunction< T, T, U >

Description

You can use this struct for example with PiiMatrix<T>::map():

 int threshold = 5;
 PiiMatrix<int> mat(1,9,1,2,3,4,5,6,7,8,9);
 mat.map<PiiImage::ThresholdFunction<int> >(threshold);

 // mat = 0 0 0 0 1 1 1 1 1

 const PiiMatrix<int> mat2(1,9,1,2,3,4,5,6,7,8,9);
 PiiMatrix<bool> binary = mat2.mapped(PiiImage::ThresholdFunction<int,bool>(), 5);

 // binary = 0 0 0 0 1 1 1 1 1

Constructors and destructor

(
  • U value = 1
)

Public member functions

U
(
  • T value
  • T threshold
)

Function details

  • ThresholdFunction

    (
    • U value = 1
    )
    [inline]
  • U operator()

    (
    • T value
    • T threshold
    )
    [inline]
Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.