ImagePreprocessingEngine class

Advanced image preprocessing engine inspired by OpenCV and Dynamsoft algorithms. Includes Sauvola/Niblack adaptive binarization, Laplacian variance blur detection, CLAHE contrast enhancement, and low-light luminance scoring.

Constructors

ImagePreprocessingEngine()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

bilateralFilter(Uint8List gray, int width, int height, {double spatialSigma = 2.0, double rangeSigma = 25.0, int kernelSize = 5}) → Uint8List
Edge-preserving bilateral filter.
computeBlurScore(Uint8List gray, int width, int height) → double
Calculates Laplacian variance sharpness score for blur detection. Inspired by OpenCV Laplacian variance algorithm.
computeLuminosityAndContrast(Uint8List gray, int width, int height) → Map<String, double>
Computes average normalized luminosity and RMS contrast score.
computeTenengradScore(Uint8List gray, int width, int height) → double
Computes Tenengrad sharpness score using Sobel gradient sum.
enhanceContrast(Uint8List gray, int width, int height) → Uint8List
Contrast Limited Adaptive Histogram Equalization (CLAHE) approximation.
gammaCorrection(Uint8List gray, int width, int height, {double gamma = 0.6}) → Uint8List
Applies Gamma Correction for low-light brightness enhancement.
histogramAutoLevels(Uint8List gray, int width, int height, {double lowPercentile = 0.01, double highPercentile = 0.99}) → Uint8List
Applies histogram auto-levels using percentile-based stretching.
multiPassAdaptivePreprocess(Uint8List rawBytes, int width, int height, {bool isLowLight = false, bool requiresBinarization = false, bool requiresSharpening = false, double blurThreshold = 80.0}) → AdaptivePreprocessResult
Multi-pass adaptive preprocessing pipeline.
otsuBinarize(Uint8List gray, int width, int height) → Uint8List
Otsu's Global Adaptive Thresholding algorithm.
processFrame(Uint8List rawBytes, int width, int height, {double blurThreshold = 80.0, bool applyBinarization = false}) → PreprocessingResult
Preprocesses a raw image frame and returns a comprehensive PreprocessingResult.
sauvolaBinarize(Uint8List gray, int width, int height, {int windowSize = 15, double k = 0.2, double r = 128.0}) → Uint8List
Sauvola's Local Adaptive Binarization algorithm for document OCR & barcode decoding. Formula: T(x,y) = m(x,y) * 1 + k * (s(x,y)/R - 1) where m = local mean, s = local std dev, k = 0.2, R = 128.
toGrayscale(Uint8List input, int width, int height, {int bytesPerPixel = 4}) → Uint8List
Converts RGB or RGBA bytes to a single-channel Grayscale Y-plane.
unsharpMask(Uint8List gray, int width, int height, {double amount = 1.0, double blurSigma = 1.0}) → Uint8List
Applies Unsharp Mask sharpening.