friday-0.1.4: A functionnal image processing library for Haskell.

Safe HaskellNone

Vision.Image.Threshold

Synopsis

Documentation

data ThresholdType src res whereSource

Specifies what to do with pixels matching the threshold predicate.

BinaryThreshold a b will replace matching pixels by a and non-matchings pixels by b.

Truncate a will replace matching pixels by a.

Constructors

BinaryThreshold :: res -> res -> ThresholdType src res 
Truncate :: src -> ThresholdType src src 

threshold :: FunctorImage src res => (ImagePixel src -> Bool) -> ThresholdType (ImagePixel src) (ImagePixel res) -> src -> resSource

Applies the given predicate and threshold policy on the image.

data AdaptiveThresholdKernel acc whereSource

Defines how pixels of the kernel of the adaptive threshold will be weighted.

With MeanKernel, pixels of the kernel have the same weight.

With GaussianKernel sigma, pixels are weighted according to their distance from the thresholded pixel using a Gaussian function parametred by sigma. See gaussianBlur for details.

adaptiveThresholdSource

Arguments

:: (Integral src, Num src, Ord src, Storable acc) 
=> AdaptiveThresholdKernel acc 
-> Int

Kernel radius.

-> src

Minimum difference between the pixel and the kernel average. The pixel is thresholded if pixel_value - kernel_mean > difference where difference if this number. Can be negative.

-> ThresholdType src res 
-> SeparableFilter src acc res 

Applies a thresholding adaptively. Compares every pixel to its surrounding ones in the kernel of the given radius.