React Native OCR - v0.11.0
    Preparing search index...

    Function extractCraftTextBoxes

    • Decodes a CRAFT region and affinity heatmap into text component boxes: thresholds the two score maps, links (or, with charLevel, separates) glyphs into connected components and fits a rotated rectangle to each.

      Line grouping and reading order are computed in TypeScript on the returned boxes.

      Parameters

      • heatmap: Tensor

        The detector's float32 output of shape [heatHeight, heatWidth, 2] (a leading batch dimension of 1 is accepted), region and affinity scores interleaved.

      • options: CraftDecodeOptions

        Decode thresholds and the heatmap-to-input scale.

      Returns CraftBox[]

      One box per surviving component, in no particular order.

      With code INVALID_ARGUMENT when the heatmap is not of the expected dtype and shape or an option is out of range.