Package com.google.zxing.common.detector
Class WhiteRectangleDetector
java.lang.Object
com.google.zxing.common.detector.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
-
Constructor Summary
ConstructorsConstructorDescriptionWhiteRectangleDetector
(BitMatrix image) WhiteRectangleDetector
(BitMatrix image, int initSize, int x, int y) -
Method Summary
Modifier and TypeMethodDescriptiondetect()
Detects a candidate barcode-like rectangular region within an image.
-
Constructor Details
-
WhiteRectangleDetector
- Throws:
NotFoundException
-
WhiteRectangleDetector
- Parameters:
image
- barcode image to find a rectangle ininitSize
- initial size of search area around centerx
- x position of search centery
- y position of search center- Throws:
NotFoundException
- if image is too small to accommodateinitSize
-
-
Method Details
-
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.
- Returns:
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- Throws:
NotFoundException
- if no Data Matrix Code can be found
-