Package org.opencv.barcode
Class BarcodeDetector
java.lang.Object
org.opencv.barcode.BarcodeDetector
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionInitialize the BarcodeDetector.protected
BarcodeDetector
(long addr) BarcodeDetector
(String prototxt_path) Initialize the BarcodeDetector.BarcodeDetector
(String prototxt_path, String model_path) Initialize the BarcodeDetector. -
Method Summary
Modifier and TypeMethodDescriptionstatic BarcodeDetector
__fromPtr__
(long addr) boolean
Decodes barcode in image once it's found by the detect() method.boolean
Detects Barcode in image and returns the rectangle(s) containing the code.boolean
Both detects and decodes barcodeboolean
Both detects and decodes barcodeprotected void
finalize()
long
-
Field Details
-
nativeObj
protected final long nativeObj
-
-
Constructor Details
-
BarcodeDetector
protected BarcodeDetector(long addr) -
BarcodeDetector
Initialize the BarcodeDetector.- Parameters:
prototxt_path
- prototxt file path for the super resolution modelmodel_path
- model file path for the super resolution model
-
BarcodeDetector
Initialize the BarcodeDetector.- Parameters:
prototxt_path
- prototxt file path for the super resolution model
-
BarcodeDetector
public BarcodeDetector()Initialize the BarcodeDetector.
-
-
Method Details
-
getNativeObjAddr
public long getNativeObjAddr() -
__fromPtr__
-
detect
Detects Barcode in image and returns the rectangle(s) containing the code.- Parameters:
img
- grayscale or color (BGR) image containing (or not) Barcode.points
- Output vector of vector of vertices of the minimum-area rotated rectangle containing the codes. 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.- Returns:
- automatically generated
-
decode
Decodes barcode in image once it's found by the detect() method.- Parameters:
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 of BarcodeType, specifies the type of these barcodes- Returns:
- automatically generated
-
detectAndDecode
public boolean detectAndDecode(Mat img, List<String> decoded_info, List<Integer> decoded_type, Mat points) Both detects and decodes barcode- Parameters:
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 BarcodeType, specifies the type of these barcodespoints
- optional output vector of vertices of the found barcode rectangle. Will be empty if not found.- Returns:
- automatically generated
-
detectAndDecode
Both detects and decodes barcode- Parameters:
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 BarcodeType, specifies the type of these barcodes- Returns:
- automatically generated
-
finalize
-