export declare function getCv(): any; /** Await this before constructing a VisionUtil or calling any cv API. */ export declare function ensureCvReady(): Promise; export interface Point { x: number; y: number; } export interface Rect { x: number; y: number; width: number; height: number; } export interface MatchResult { location: Point; confidence: number; rect: Rect; } /** * Computer vision utilities for image processing, template matching, and alignment */ export declare class VisionUtil { /** * Load an image from a buffer into an OpenCV Mat */ loadImage(buffer: Buffer): any; /** * Convert a colored image to grayscale */ toGrayscale(image: any): any; /** * Perform template matching to find a template image within a larger image * Returns the best match location and confidence */ matchTemplate(source: any, template: any, method?: number): MatchResult; /** * Extract a region of interest (ROI) from an image */ extractROI(image: any, rect: Rect): any; /** * Compare two images and count the number of different pixels * Returns the count and whether they're considered different */ compareRegions(image1: any, image2: any, threshold?: number, minDiffPixels?: number): { different: boolean; diffPixelCount: number; diffPercentage: number; }; /** * Create a difference image highlighting where two images differ */ createDiffImage(image1: any, image2: any, threshold?: number): any; /** * Keep filled-form pixels that changed vs blank; paint unchanged pixels white. * Labels and box borders drop out so OCR reads only typed values. */ isolateChangedForOcr(filled: any, blank: any, threshold?: number): any; /** * Count pixels darker than `limit` (after converting color crops to gray). */ countDarkPixels(image: any, limit?: number): number; hasEnoughInk(image: any, minPixels?: number): boolean; /** * Whether a checkbox crop looks checked. * Ignores the box border (inset) and looks for ink in the interior, so an * empty box is unchecked without a second template or a blank-screenshot match. */ checkboxChecked(image: any, options?: { inset?: number; darkLimit?: number; minInk?: number; }): boolean; ocrPrepOptions(image: any, options?: { charset?: string; scale?: number; }): { scale: number; threshold?: number; }; /** * Upscale, pad, and binarize a crop so Tesseract can read 18px UI text. * Short crops use a fixed threshold — Otsu on tiny digits fattens 0 into 8. */ prepareForOcr(image: any, scale?: number, options?: { threshold?: number; charset?: string; }): any; /** * Draw labeled rectangles on a clone of the screenshot (RGBA or gray). */ annotateRects(image: any, boxes: Array<{ rect: Rect; label?: string; color?: [number, number, number, number]; }>): any; /** * Align two images using feature detection and homography * This corrects for rotation, skew, and perspective differences */ alignImages(filledForm: any, blankForm: any): any; /** * Convert a cv.Mat to a PNG buffer */ matToBuffer(mat: any): Buffer; /** * Use pixelmatch for fast pixel-level comparison * Returns the number of mismatched pixels */ pixelMatch(img1: Buffer, img2: Buffer, options?: { threshold?: number; includeAA?: boolean; }): { mismatchedPixels: number; diffBuffer: Buffer | null; }; } //# sourceMappingURL=vision.d.ts.map