Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::binary::AdaptiveThresholding Class Reference

#include <AdaptiveThresholding.h>

List of all members.


Detailed Description

A class for "adaptive binarization".

Instead of the global thresholding performed for example by util::MatrixUtils::compare(), this class is able of adaptively changing the binarization threshold. The threshold is presented as a percentage of a local average. That is, if you set the threshold to 0.1, pixel values less than 10% of the local average are set to zero. If the threshold is one, everything below average is reset to zero.

The thresholding works in two modes: "pixel" and "block". In pixel mode, each pixel is thresholded based on the neighborhood around it. In block mode, each neighborhood is thresholded block-wise.


Static Public Methods

template<class T> util::Matrix< T > threshold (const util::Matrix< T > &mat, double threshold=1, bool pixelMode=false, int neighborhoodSize=16, bool setToOne=false)
 Adaptively threshold an image.


Member Function Documentation

template<class T>
util::Matrix< T > prapi::binary::AdaptiveThresholding::threshold const util::Matrix< T > &    mat,
double    threshold = 1,
bool    pixelMode = false,
int    neighborhoodSize = 16,
bool    setToOne = false
[static]
 

Adaptively threshold an image.

Parameters:
threshold  the threshold
pixelMode  if true, thresholding is made pixel-wise
neighborhoodSize  the size of the neighborhood to consider in calculation
setToOne  if true, pixels that exceed the threshold are set to one. If false, they are left intact.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.