/** * Image Quality Assessment for Document Capture * Client-side quality checks before sending to backend */ export interface QualityMetrics { sharpness: number; contrast: number; brightness: number; isBlurry: boolean; hasGlare: boolean; overallScore: number; } export interface QualityFeedback { isValid: boolean; message: string; recommendations: string[]; quality: QualityMetrics; } /** * Calculate image sharpness using Laplacian variance * Higher values = sharper image */ export declare function calculateSharpness(imageData: ImageData): number; /** * Detect glare (overexposed areas) */ export declare function detectGlare(imageData: ImageData, threshold?: number): number; /** * Calculate contrast (standard deviation) */ export declare function calculateContrast(imageData: ImageData): number; /** * Calculate brightness (mean pixel value) */ export declare function calculateBrightness(imageData: ImageData): number; /** * Full quality assessment. * * Threshold note: these cutoffs (sharpness<80, glare>15%, brightness * outside 50-200, contrast<30) are not calibrated against a specific input * resolution — Laplacian-variance sharpness in particular scales with image * size, so scoring a full-resolution capture vs. a downscaled copy can * shift the result. Caller (DocumentCapture._checkPhotoQuality) downscales * to a fixed 640px before calling this, so keep that pairing consistent — * if the downscale size changes, these thresholds should be re-checked * against real captures at the new size. This function is used as an * advisory-only nudge (never blocks submission), so a threshold that's * somewhat off costs an occasional wrong nudge, not a broken flow. */ export declare function assessQuality(imageData: ImageData): QualityFeedback; /** * Get quality color for UI feedback */ export declare function getQualityColor(score: number): string; /** * Get quality message for display */ export declare function getQualityMessage(score: number): string; //# sourceMappingURL=ImageQuality.d.ts.map