Safe Haskell | Safe-Infered |
---|
Image thresholding operations
- data ThresholdType
- threshold :: MaxVal d => ThresholdType -> Double -> Image GrayScale d -> Image GrayScale d
- thresholdOtsu :: ThresholdType -> Image GrayScale D8 -> Image GrayScale D8
- data AdaptiveType
- = ByMean
- | ByGaussian
- adaptiveThreshold :: MaxVal d => AdaptiveType -> ThresholdType -> Int -> Double -> Image GrayScale d -> Image GrayScale d
- bernsen :: (CInt, CInt) -> D32 -> Image GrayScale D32 -> Image GrayScale D8
- nibbly :: D32 -> D32 -> Image GrayScale D32 -> Image GrayScale D8
- nibblyr :: (Int, Int) -> D32 -> Image GrayScale D32 -> Image GrayScale D8
- kittler :: D32 -> Image GrayScale D32 -> Image GrayScale D8
- kittlerMeasure :: Image GrayScale D32 -> D32 -> D32
- betweenClassVariance :: Fractional a => [a] -> [a] -> a
Interfaces to OpenCV functions
data ThresholdType Source
Thresholding behavior for values larger and smaller than threshold
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
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