Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WhiteRectangleDetector

Detects a candidate barcode-like rectangular region within an image. It starts around the center of the image, increases the size of the candidate region until it finds a white rectangular region. By keeping track of the last black points it encountered, it determines the corners of the barcode.

author

David Olivier

Hierarchy

  • WhiteRectangleDetector

Index

Constructors

constructor

Properties

Private downInit

downInit: number

Private height

height: number

Private image

image: BitMatrix

barcode image to find a rectangle in

Private leftInit

leftInit: number

Private rightInit

rightInit: number

Private upInit

upInit: number

Private width

width: number

Static Private CORR

CORR: number = 1

Static Private INIT_SIZE

INIT_SIZE: number = 10

Methods

Private centerEdges

Private containsBlackPoint

  • containsBlackPoint(a: number, b: number, fixed: number, horizontal: boolean): boolean
  • Determines whether a segment contains a black point

    Parameters

    • a: number

      min value of the scanned coordinate

    • b: number

      max value of the scanned coordinate

    • fixed: number

      value of fixed coordinate

    • horizontal: boolean

      set to true if scan must be horizontal, false if vertical

    Returns boolean

    true if a black point has been found, else false.

detect

  • Detects a candidate barcode-like rectangular region within an image. It starts around the center of the image, increases the size of the candidate region until it finds a white rectangular region.

    throws

    NotFoundException if no Data Matrix Code can be found

    Returns Array<ResultPoint>

    ResultPoint[] describing the corners of the rectangular region. The first and last points are opposed on the diagonal, as are the second and third. The first point will be the topmost point and the last, the bottommost. The second point will be leftmost and the third, the rightmost

Private getBlackPointOnSegment

  • getBlackPointOnSegment(aX: number, aY: number, bX: number, bY: number): ResultPoint | null

Generated using TypeDoc