Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ThresholdType src res where
- BinaryThreshold :: res -> res -> ThresholdType src res
- Truncate :: src -> ThresholdType src src
- threshold :: FunctorImage src res => (ImagePixel src -> Bool) -> ThresholdType (ImagePixel src) (ImagePixel res) -> src -> res
- data AdaptiveThresholdKernel acc where
- MeanKernel :: Integral acc => AdaptiveThresholdKernel acc
- GaussianKernel :: (Floating acc, RealFrac acc) => Maybe acc -> AdaptiveThresholdKernel acc
- adaptiveThreshold :: (Integral src, Num src, Ord src, Storable acc) => AdaptiveThresholdKernel acc -> Int -> src -> ThresholdType src res -> SeparableFilter src acc res
Documentation
data ThresholdType src res where Source
Specifies what to do with pixels matching the threshold predicate.
will replace matching pixels by BinaryThreshold
a ba
and non-matchings
pixels by b
.
will replace matching pixels by Truncate
aa
.
BinaryThreshold :: res -> res -> ThresholdType src res | |
Truncate :: src -> ThresholdType src src |
threshold :: FunctorImage src res => (ImagePixel src -> Bool) -> ThresholdType (ImagePixel src) (ImagePixel res) -> src -> res Source
Applies the given predicate and threshold policy on the image.
data AdaptiveThresholdKernel acc where Source
Defines how pixels of the kernel of the adaptive threshold will be weighted.
With MeanKernel
, pixels of the kernel have the same weight.
With
, pixels are weighted according to their distance
from the thresholded pixel using a Gaussian function parametred by GaussianKernel
sigmasigma
.
See gaussianBlur
for details.
MeanKernel :: Integral acc => AdaptiveThresholdKernel acc | |
GaussianKernel :: (Floating acc, RealFrac acc) => Maybe acc -> AdaptiveThresholdKernel acc |
:: (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
|
-> 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.