类 WeChatQRCode
- java.lang.Object
-
- org.opencv.wechat_qrcode.WeChatQRCode
-
public class WeChatQRCode extends java.lang.ObjectWeChat QRCode 包括两个基于 CNN 的模型:一个对象检测模型和一个超分辨率模型。对象检测模型用于检测带有边界框的 QRCode。超分辨率模型用于放大较小的 QRCode。
-
-
字段摘要
字段 修饰符和类型 字段 描述 protected longnativeObj
-
构造函数摘要
构造函数 修饰符 构造函数 描述 WeChatQRCode()初始化 WeChatQRCode。保护WeChatQRCode(long addr)WeChatQRCode(java.lang.String detector_prototxt_path)初始化 WeChatQRCode。WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path)初始化 WeChatQRCode。WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path)初始化 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)初始化 WeChatQRCode。
-
方法摘要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 描述 static WeChatQRCode__fromPtr__(long addr)java.util.List<java.lang.String>detectAndDecode(Mat img)同时检测和解码 QR 码。java.util.List<java.lang.String>detectAndDecode(Mat img, java.util.List<Mat> points)同时检测和解码 QR 码。protected voidfinalize()longgetNativeObjAddr()floatgetScaleFactor()voidsetScaleFactor(float _scalingFactor)设置缩放因子。QR 码检测器使用神经网络来检测 QR 码。
-
-
-
构造函数详细信息
-
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)初始化 WeChatQRCode。它包括两个模型,这两个模型都使用 caffe 格式打包。因此,有 prototxt 和 caffe 模型(总共四个参数)。- 参数
detector_prototxt_path- 检测器的 prototxt 文件路径detector_caffe_model_path- 检测器的 caffe 模型文件路径super_resolution_prototxt_path- 超分辨率模型的 prototxt 文件路径super_resolution_caffe_model_path- 超分辨率模型的 caffe 文件路径
-
WeChatQRCode
public WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path, java.lang.String super_resolution_prototxt_path)初始化 WeChatQRCode。它包括两个模型,这两个模型都使用 caffe 格式打包。因此,有 prototxt 和 caffe 模型(总共四个参数)。- 参数
detector_prototxt_path- 检测器的 prototxt 文件路径detector_caffe_model_path- 检测器的 caffe 模型文件路径super_resolution_prototxt_path- 超分辨率模型的 prototxt 文件路径
-
WeChatQRCode
public WeChatQRCode(java.lang.String detector_prototxt_path, java.lang.String detector_caffe_model_path)初始化 WeChatQRCode。它包括两个模型,这两个模型都使用 caffe 格式打包。因此,有 prototxt 和 caffe 模型(总共四个参数)。- 参数
detector_prototxt_path- 检测器的 prototxt 文件路径detector_caffe_model_path- 检测器的 caffe 模型文件路径
-
WeChatQRCode
public WeChatQRCode(java.lang.String detector_prototxt_path)
初始化 WeChatQRCode。它包括两个模型,这两个模型都使用 caffe 格式打包。因此,有 prototxt 和 caffe 模型(总共四个参数)。- 参数
detector_prototxt_path- 检测器的 prototxt 文件路径
-
WeChatQRCode
public WeChatQRCode()
初始化 WeChatQRCode。它包括两个模型,这两个模型都使用 caffe 格式打包。因此,有 prototxt 和 caffe 模型(总共四个参数)。
-
-
方法详细信息
-
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)
同时检测和解码 QR 码。为了简化使用,只有一个 API:detectAndDecode- 参数
img- 支持灰度或彩色 (BGR) 图像。points- 可选的输出数组,包含找到的 QR 码四边形的顶点。如果未找到,则为空。- 返回
- 解码字符串列表。
-
detectAndDecode
public java.util.List<java.lang.String> detectAndDecode(Mat img)
同时检测和解码 QR 码。为了简化使用,只有一个 API:detectAndDecode- 参数
img- 支持灰度或彩色 (BGR) 图像。如果未找到,则为空。- 返回
- 解码字符串列表。
-
setScaleFactor
public void setScaleFactor(float _scalingFactor)
设置缩放因子。QR 码检测器使用神经网络来检测 QR 码。在运行神经网络之前,通过缩放预处理输入图像。默认情况下,输入图像被缩放到面积为 160000 像素的图像。缩放因子允许使用自定义缩放输入图像:宽度 = scaleFactor*宽度 高度 = scaleFactor*宽度 scaleFactor 值必须 > 0 且 <= 1,否则 scaleFactor 值将设置为 -1,并使用默认缩放至面积为 160000 像素的图像。- 参数
_scalingFactor- 自动生成
-
getScaleFactor
public float getScaleFactor()
-
finalize
protected void finalize() throws java.lang.Throwable- 重写
finalize在类java.lang.Object中- 抛出
java.lang.Throwable
-
-