/** * Image preprocessing for PaddleOCR PP-OCRv6 small recognition. * * Matches PaddleOCR's OCRReisizeNormImg (paddlex/inference/models/text_recognition/processors.py): * - Resize to height 48 preserving aspect ratio; width = int(48 * max(320/48, w/h)) * - Cap width at maxImgW (3200) * - Normalize: (x/255 - 0.5) / 0.5 → range [-1, 1] * - Pad remaining width with ZEROS (black, which is -1.0 after normalization) * - Channel order: BGR (PaddleOCR default), NCHW [1, 3, 48, W] */ export interface PreprocessedImage { shape: [1, 3, 48, number]; data: Float32Array; } export declare function preprocessImage(src: HTMLCanvasElement | HTMLImageElement | ImageData | Uint8ClampedArray, maxWidth?: number): PreprocessedImage; /** Variant that orders channels RGB (used by PP-OCRv6 small_rec). */ export declare function preprocessImageRGB(src: HTMLCanvasElement | HTMLImageElement | ImageData | Uint8ClampedArray, maxWidth?: number): PreprocessedImage; //# sourceMappingURL=preprocess.d.ts.map