Package org.opencv.wechat_qrcode
Class WeChatQRCode
- java.lang.Object
-
- org.opencv.wechat_qrcode.WeChatQRCode
-
public class WeChatQRCode extends java.lang.Object
WeChat 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 Summary
Fields Modifier and Type Field Description protected long
nativeObj
-
Constructor Summary
Constructors Modifier Constructor Description WeChatQRCode()
Initialize the WeChatQRCode.protected
WeChatQRCode(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 Summary
All 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 void
finalize()
long
getNativeObjAddr()
-
-
-
Constructor Detail
-
WeChatQRCode
protected WeChatQRCode(long addr)
-
WeChatQRCode
public 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 detectordetector_caffe_model_path
- caffe model file path for the detectorsuper_resolution_prototxt_path
- prototxt file path for the super resolution modelsuper_resolution_caffe_model_path
- caffe file path for the super resolution model
-
WeChatQRCode
public 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 detectordetector_caffe_model_path
- caffe model file path for the detectorsuper_resolution_prototxt_path
- prototxt file path for the super resolution model
-
WeChatQRCode
public 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 detectordetector_caffe_model_path
- caffe model file path for the detector
-
WeChatQRCode
public 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
-
WeChatQRCode
public 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
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static WeChatQRCode __fromPtr__(long addr)
-
detectAndDecode
public 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.
-
detectAndDecode
public 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.
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-