ddddocr-node
    Preparing search index...

    Class DdddOcr

    Index

    Constructors

    Methods

    • Classifies an image by running it through an OCR model.

      Parameters

      • url: string

      Returns Promise<string>

    • Detects objects in an image by extracting bounding boxes and optionally visualizing the detection results on the image.

      This method reads the image, retrieves bounding boxes, and then optionally draws the detected bounding boxes on the image if debugging is enabled.

      Parameters

      • url: string

      Returns Promise<number[][]>

    • Enables the debug mode and prepares the debug folder.

      Returns this

    • Sets the range restriction for OCR results.

      This method restricts the characters returned by OCR based on the input:

      • For number input, it applies a predefined character set. See the CHARSET_RANGE type for the available options.
      • For string input, each character in the string is treated as a valid OCR result.

      Parameters

      Returns this

    • Finds the slider gap position by comparing two images: one with a gap shadow/highlight visible, and the full background image. Returns the center coordinates of the largest connected difference region.

      Parameters

      • targetImage: ImageInput
      • backgroundImage: ImageInput

      Returns Promise<SlideComparisonResult>

    • Matches a slider puzzle piece against a background image.

      • When simpleTarget is false (default), Canny edge detection is applied before template matching — suited for puzzle pieces with transparent backgrounds.
      • When simpleTarget is true, grayscale template matching is used directly — suited for simple (opaque) puzzle pieces.

      Parameters

      • targetImage: ImageInput
      • backgroundImage: ImageInput
      • simpleTarget: boolean = false

      Returns Promise<SlideMatchResult>