CV-0.3.5.4: OpenCV based machine vision library

Safe HaskellSafe-Infered

CV.Thresholding

Contents

Description

Image thresholding operations

Synopsis

Interfaces to OpenCV functions

data ThresholdType Source

Thresholding behavior for values larger and smaller than threshold

Constructors

MaxAndZero

Values larger than threshold are set to max, smaller to zero

ZeroAndMax

Values larger than threshold are set to zero, smaller to max

ThreshAndValue

Values larger than threshold are truncated to threshold, smaller are not touched

ValueAndZero

Values larger than threshold are not touched, smaller are set to zero

ZeroAndValue

Values larger than threshold are set to zero, smaller are not touched

threshold :: MaxVal d => ThresholdType -> Double -> Image GrayScale d -> Image GrayScale dSource

Thresholds a grayscale image according to the selected type, using the given threshold value.

thresholdOtsu :: ThresholdType -> Image GrayScale D8 -> Image GrayScale D8Source

Thresholds a grayscale image using the otsu method according to the selected type. Threshold value is selected automatically, and only 8-bit images are supported.

data AdaptiveType Source

Method used for selecting the adaptive threshold value

Constructors

ByMean

Threshold using the arithmetic mean of pixel neighborhood

ByGaussian

Threshold using the gaussian weighted mean of pixel neighborhood

adaptiveThreshold :: MaxVal d => AdaptiveType -> ThresholdType -> Int -> Double -> Image GrayScale d -> Image GrayScale dSource

Applies adaptive thresholding by selecting the optimal threshold value for each pixel. The threshold is selected by calculating the arithmetic or gaussian-weighted mean of a pixel neighborhood, and applying a bias term to the obtained value.

Other methods

betweenClassVariance :: Fractional a => [a] -> [a] -> aSource