image_quality_gate_io library

Background evaluation for native platforms (not web).

Classes

ContrastCheck
Low contrast, measured as RMS contrast: the standard deviation of luminance normalised to 0..1 (Peli, 1990). 0 is a flat image, 0.5 is the maximum (half black, half white).
DocumentFillCheck
A heuristic for "the document is too small in the frame".
ExposureCheck
Exposure: mean luminance and clipped highlights and shadows.
GlareCheck
Glare: saturated near-white pixels, as left by a flash or a lamp reflecting off glossy paper or a laminated card.
ImageQualityGate
Measures a photo and decides whether it is good enough to use.
PixelRect
An axis-aligned rectangle in pixel coordinates.
QualityConfig
Which checks run, with which thresholds, on which part of the frame.
QualityIssue
One failed check, with the value that was measured and the limit it broke.
QualityMessages
User-facing messages for each QualityIssueCode.
QualityMetrics
Every raw measurement taken, whether or not a check used it.
QualityReport
The outcome of evaluating one image.
RegionOfInterest
The part of the frame that sharpness, exposure, glare, contrast and document-fill checks look at. Resolution checks always use the full image.
ResolutionCheck
Resolution and shape of the full image (the region of interest is not used here). A limit of 0 or null is not checked.
SharpnessCheck
Blur detection.

Enums

IssueSeverity
How serious an issue is. Only error makes QualityReport.passed false.
QualityCheck
The individual checks, used by QualityConfig.copyWith to disable them.
QualityIssueCode
What went wrong with a photo. Each code maps to one actionable message in QualityMessages.
ThresholdKind
Whether the threshold that was crossed is a lower or an upper bound.

Functions

evaluateInIsolate(Uint8List bytes, [QualityConfig config = QualityConfig.document]) → Future<QualityReport>
Decodes and evaluates bytes on a short-lived background isolate (Isolate.run), so a large photo does not block the UI isolate.

Exceptions / Errors

UndecodableImageException
Thrown by ImageQualityGate.evaluate when the bytes are not an image format package:image can decode.