import * as ort from "onnxruntime-node";
import { Canvas } from "ppu-ocv";
import type { Box, DebuggingOptions, DetectionOptions } from "../interface";
/**
 * Result of preprocessing an image for text detection
 */
export interface PreprocessDetectionResult {
    tensor: Float32Array;
    width: number;
    height: number;
    resizeRatio: number;
    originalWidth: number;
    originalHeight: number;
}
/**
 * Service for detecting text regions in images
 */
export declare class DetectionService {
    private readonly options;
    private readonly debugging;
    private readonly session;
    private static readonly NUM_CHANNELS;
    constructor(session: ort.InferenceSession, options?: Partial<DetectionOptions>, debugging?: Partial<DebuggingOptions>);
    /**
     * Logs a message if verbose debugging is enabled
     */
    private log;
    /**
     * Main method to run text detection on an image
     * @param image ArrayBuffer of the image or Canvas
     */
    run(image: ArrayBuffer | Canvas): Promise<Box[]>;
    /**
     * Preprocess an image for text detection
     */
    private preprocessDetection;
    /**
     * Calculate dimensions for resizing the image
     */
    private calculateResizeDimensions;
    /**
     * Create a padded canvas from the resized image
     */
    private createPaddedCanvas;
    /**
     * Convert an image to a normalized tensor for model input
     */
    private imageToTensor;
    /**
     * Run the detection model inference
     */
    private runInference;
    /**
     * Convert a tensor to a canvas for visualization and processing
     */
    private tensorToCanvas;
    /**
     * Process detection results to extract bounding boxes
     */
    private postprocessDetection;
    /**
     * Extract boxes from contours
     */
    private extractBoxesFromContours;
    /**
     * Apply padding to a rectangle
     */
    private applyPaddingToRect;
    /**
     * Convert coordinates from resized image back to original image
     */
    private convertToOriginalCoordinates;
    /**
     * Debug the detection canvas in binary image format (thresholded)
     */
    private debugDetectionCanvas;
    /**
     * Debug the bounding boxes by drawinga rectangle onto the original image
     */
    private debugDetectedBoxes;
}
