public class BarcodeDetector extends GraphicalCodeDetector
nativeObj
Modifier | Constructor and Description |
---|---|
|
BarcodeDetector()
Initialize the BarcodeDetector.
|
protected |
BarcodeDetector(long addr) |
|
BarcodeDetector(String prototxt_path,
String model_path)
Initialize the BarcodeDetector.
|
Modifier and Type | Method and Description |
---|---|
static BarcodeDetector |
__fromPtr__(long addr) |
boolean |
decodeWithType(Mat img,
Mat points,
List<String> decoded_info,
List<String> decoded_type)
Decodes barcode in image once it's found by the detect() method.
|
boolean |
detectAndDecodeWithType(Mat img,
List<String> decoded_info,
List<String> decoded_type)
Both detects and decodes barcode
|
boolean |
detectAndDecodeWithType(Mat img,
List<String> decoded_info,
List<String> decoded_type,
Mat points)
Both detects and decodes barcode
|
protected void |
finalize() |
void |
getDetectorScales(MatOfFloat sizes)
Returns detector box filter sizes.
|
double |
getDownsamplingThreshold()
Get detector downsampling threshold.
|
double |
getGradientThreshold()
Get detector gradient magnitude threshold.
|
BarcodeDetector |
setDetectorScales(MatOfFloat sizes)
Set detector box filter sizes.
|
BarcodeDetector |
setDownsamplingThreshold(double thresh)
Set detector downsampling threshold.
|
BarcodeDetector |
setGradientThreshold(double thresh)
Set detector gradient magnitude threshold.
|
decode, decode, decodeMulti, decodeMulti, detect, detectAndDecode, detectAndDecode, detectAndDecode, detectAndDecodeMulti, detectAndDecodeMulti, detectAndDecodeMulti, detectMulti, getNativeObjAddr
protected BarcodeDetector(long addr)
public BarcodeDetector()
public BarcodeDetector(String prototxt_path, String model_path)
prototxt_path
- prototxt file path for the super resolution modelmodel_path
- model file path for the super resolution modelpublic static BarcodeDetector __fromPtr__(long addr)
public boolean decodeWithType(Mat img, Mat points, List<String> decoded_info, List<String> decoded_type)
img
- grayscale or color (BGR) image containing bar code.points
- vector of rotated rectangle vertices found by detect() method (or some other algorithm).
For N detected barcodes, the dimensions of this array should be [N][4].
Order of four points in vector<Point2f> is bottomLeft, topLeft, topRight, bottomRight.decoded_info
- UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.decoded_type
- vector strings, specifies the type of these barcodespublic boolean detectAndDecodeWithType(Mat img, List<String> decoded_info, List<String> decoded_type, Mat points)
img
- grayscale or color (BGR) image containing barcode.decoded_info
- UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.decoded_type
- vector of strings, specifies the type of these barcodespoints
- optional output vector of vertices of the found barcode rectangle. Will be empty if not found.public boolean detectAndDecodeWithType(Mat img, List<String> decoded_info, List<String> decoded_type)
img
- grayscale or color (BGR) image containing barcode.decoded_info
- UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.decoded_type
- vector of strings, specifies the type of these barcodespublic double getDownsamplingThreshold()
public BarcodeDetector setDownsamplingThreshold(double thresh)
thresh
- downsampling limit to apply (default 512)
SEE: setDetectorScalespublic void getDetectorScales(MatOfFloat sizes)
sizes
- output parameter for returning the sizes.public BarcodeDetector setDetectorScales(MatOfFloat sizes)
sizes
- box filter sizes, relative to minimum dimension of the image (default [0.01, 0.03, 0.06, 0.08])public double getGradientThreshold()
public BarcodeDetector setGradientThreshold(double thresh)
thresh
- gradient magnitude threshold (default 64).protected void finalize() throws Throwable
finalize
in class GraphicalCodeDetector
Throwable
Copyright © 2024. All rights reserved.