Package org.opencv.wechat_qrcode
Class WeChatQRCode
- java.lang.Object
- 
- org.opencv.wechat_qrcode.WeChatQRCode
 
- 
 public class WeChatQRCode extends java.lang.ObjectWeChat QRCode includes two CNN-based models: A object detection model and a super resolution model. Object detection model is applied to detect QRCode with the bounding box. super resolution model is applied to zoom in QRCode when it is small.
- 
- 
Field SummaryFields Modifier and Type Field Description protected longnativeObj
 - 
Constructor SummaryConstructors Modifier Constructor Description WeChatQRCode()Initialize the WeChatQRCode.protectedWeChatQRCode(long addr)WeChatQRCode(java.lang.String detector_prototxt_path)Initialize the WeChatQRCode.WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path)Initialize the WeChatQRCode.WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path)Initialize the WeChatQRCode.WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path, java.lang.String super_resolution_caffe_model_path)Initialize the WeChatQRCode.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WeChatQRCode__fromPtr__(long addr)java.util.List<java.lang.String>detectAndDecode(Mat img)Both detects and decodes QR code.java.util.List<java.lang.String>detectAndDecode(Mat img, java.util.List<Mat> points)Both detects and decodes QR code.protected voidfinalize()longgetNativeObjAddr()floatgetScaleFactor()voidsetScaleFactor(float _scalingFactor)set scale factor QR code detector use neural network to detect QR.
 
- 
- 
- 
Constructor Detail- 
WeChatQRCodeprotected WeChatQRCode(long addr) 
 - 
WeChatQRCodepublic WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path, java.lang.String super_resolution_caffe_model_path)Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).- Parameters:
- detector_prototxt_path- prototxt file path for the detector
- detector_caffe_model_path- caffe model file path for the detector
- super_resolution_prototxt_path- prototxt file path for the super resolution model
- super_resolution_caffe_model_path- caffe file path for the super resolution model
 
 - 
WeChatQRCodepublic WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path)Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).- Parameters:
- detector_prototxt_path- prototxt file path for the detector
- detector_caffe_model_path- caffe model file path for the detector
- super_resolution_prototxt_path- prototxt file path for the super resolution model
 
 - 
WeChatQRCodepublic WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path)Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).- Parameters:
- detector_prototxt_path- prototxt file path for the detector
- detector_caffe_model_path- caffe model file path for the detector
 
 - 
WeChatQRCodepublic WeChatQRCode(java.lang.String detector_prototxt_path) Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).- Parameters:
- detector_prototxt_path- prototxt file path for the detector
 
 - 
WeChatQRCodepublic WeChatQRCode() Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).
 
- 
 - 
Method Detail- 
getNativeObjAddrpublic long getNativeObjAddr() 
 - 
__fromPtr__public static WeChatQRCode __fromPtr__(long addr) 
 - 
detectAndDecodepublic java.util.List<java.lang.String> detectAndDecode(Mat img, java.util.List<Mat> points) Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode- Parameters:
- img- supports grayscale or color (BGR) image.
- points- optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
- Returns:
- list of decoded string.
 
 - 
detectAndDecodepublic java.util.List<java.lang.String> detectAndDecode(Mat img) Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode- Parameters:
- img- supports grayscale or color (BGR) image. empty if not found.
- Returns:
- list of decoded string.
 
 - 
setScaleFactorpublic void setScaleFactor(float _scalingFactor) set scale factor QR code detector use neural network to detect QR. Before running the neural network, the input image is pre-processed by scaling. By default, the input image is scaled to an image with an area of 160000 pixels. The scale factor allows to use custom scale the input image: width = scaleFactor*width height = scaleFactor*width scaleFactor valuse must be > 0 and <= 1, otherwise the scaleFactor value is set to -1 and use default scaled to an image with an area of 160000 pixels.- Parameters:
- _scalingFactor- automatically generated
 
 - 
getScaleFactorpublic float getScaleFactor() 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-