Preparing search index...

    Function mergeStripResults

    • Merges the results recognized in overlapping strips into one result in full-image coordinates.

      Lines without a frame are dropped since their position, and so their duplicates, cannot be known. A line within half its own height from an inner strip edge may be truncated: it is dropped when another strip fully contains it, and kept otherwise, so a line too tall to fit safely in any strip is never lost. A line seen in two different strips is kept once, the copy farthest from its strip's inner edges, staying in the block of the copy seen first. Two lines of the same strip are never merged, even on the same row. Kept lines stay grouped in the block ML Kit gave them, and blocks are ordered top to bottom.

      Parameters

      • stripResults: { strip: OcrStrip; result: TextRecognitionResult }[]

        Recognition result of each strip, paired with its strip

      • imageHeight: number

        Height of the full image

      Returns TextRecognitionResult

      The merged result