DocumentScannerService class
Specialized service providing Document Edge Detection, Perspective Matrix calculations, Shadow Removal image filters, Image Compression, and Auto Crop bounds.
Constructors
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
-
analyzeBlurLevel(
Uint8List grayBytes, {required int width, required int height}) → String - Analyzes blur severity of a grayscale image buffer using Laplacian variance.
-
analyzeLightCondition(
Uint8List grayBytes) → String - Analyzes ambient light condition from grayscale frame luminance.
-
applyBinarizationFilter(
Uint8List grayBytes, {int threshold = 128}) → Uint8List - Converts grayscale buffer to pure black and white (monochrome) document scan.
-
applyBrightnessContrastFilter(
Uint8List grayBytes, {double brightness = 0.0, double contrast = 1.0}) → Uint8List - Applies custom brightness and contrast adjustment to grayscale bytes.
-
applyFilter(
Uint8List bytes, DocumentFilterMode filterMode, {int binarizationThreshold = 128, int? width, int? height}) → Uint8List - High-level filter dispatcher applying selected DocumentFilterMode to image bytes.
-
applyGrayscaleFilter(
Uint8List bytes) → Uint8List - Creates a defensive copy of a single-channel grayscale byte buffer.
-
applyMagicColorFilter(
Uint8List grayBytes) → Uint8List - Applies Magic Color document enhancement (contrast boost + high clarity).
-
applyShadowRemovalFilter(
Uint8List grayBytes) → Uint8List - Applies shadow removal and background whitening to document byte buffer.
-
autoCorrectSkew(
Uint8List grayBytes, {required int width, required int height}) → Uint8List - Applies automatic skew correction by rotating pixel rows based on detected angle.
-
compressImageBytes(
Uint8List rawBytes, {double quality = 0.8}) → Uint8List - Compresses document raw bytes buffer by downsampling stride step for enterprise efficiency.
-
computePerspectiveTransform(
DocumentCorners corners, Size targetSize) → Matrix4 - Calculates perspective transformation matrix to flatten quadrilateral into rectangle.
-
computeSkewAngle(
Uint8List grayBytes, {required int width, required int height}) → double - Computes the estimated skew angle in degrees from edge gradients.
-
detectDocumentEdges(
Size imageSize) → DocumentCorners - Detects document rectangular corners in image frame dimensions.