Package org.opencv.objdetect
Class BarcodeDetector
- java.lang.Object
- 
- org.opencv.objdetect.GraphicalCodeDetector
- 
- org.opencv.objdetect.BarcodeDetector
 
 
- 
 public class BarcodeDetector extends GraphicalCodeDetector 
- 
- 
Field Summary- 
Fields inherited from class org.opencv.objdetect.GraphicalCodeDetectornativeObj
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description BarcodeDetector()Initialize the BarcodeDetector.protectedBarcodeDetector(long addr)BarcodeDetector(java.lang.String prototxt_path, java.lang.String model_path)Initialize the BarcodeDetector.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BarcodeDetector__fromPtr__(long addr)booleandecodeWithType(Mat img, Mat points, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)Decodes barcode in image once it's found by the detect() method.booleandetectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)Both detects and decodes barcodebooleandetectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type, Mat points)Both detects and decodes barcodeprotected voidfinalize()- 
Methods inherited from class org.opencv.objdetect.GraphicalCodeDetectordecode, decode, decodeMulti, decodeMulti, detect, detectAndDecode, detectAndDecode, detectAndDecode, detectAndDecodeMulti, detectAndDecodeMulti, detectAndDecodeMulti, detectMulti, getNativeObjAddr
 
- 
 
- 
- 
- 
Constructor Detail- 
BarcodeDetectorprotected BarcodeDetector(long addr) 
 - 
BarcodeDetectorpublic BarcodeDetector() Initialize the BarcodeDetector.
 - 
BarcodeDetectorpublic BarcodeDetector(java.lang.String prototxt_path, java.lang.String model_path)Initialize the BarcodeDetector. Parameters allow to load _optional_ Super Resolution DNN model for better quality.- Parameters:
- prototxt_path- prototxt file path for the super resolution model
- model_path- model file path for the super resolution model
 
 
- 
 - 
Method Detail- 
__fromPtr__public static BarcodeDetector __fromPtr__(long addr) 
 - 
decodeWithTypepublic boolean decodeWithType(Mat img, Mat points, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type) 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 strings, specifies the type of these barcodes
- Returns:
- true if at least one valid barcode have been found
 
 - 
detectAndDecodeWithTypepublic boolean detectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> 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 strings, specifies the type of these barcodes
- points- optional output vector of vertices of the found barcode rectangle. Will be empty if not found.
- Returns:
- true if at least one valid barcode have been found
 
 - 
detectAndDecodeWithTypepublic boolean detectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type) 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 strings, specifies the type of these barcodes
- Returns:
- true if at least one valid barcode have been found
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- GraphicalCodeDetector
- Throws:
- java.lang.Throwable
 
 
- 
 
-