WeChatQRCode 包含两个基于 CNN 的模型:一个对象检测模型和一个超分辨率模型。对象检测模型用于通过边界框检测 QR 码。超分辨率模型用于放大较小的 QR 码。更多...
#include <opencv2/wechat_qrcode.hpp>
|
| | WeChatQRCode (const std::string &detector_prototxt_path="", const std::string &detector_caffe_model_path="", const std::string &super_resolution_prototxt_path="", const std::string &super_resolution_caffe_model_path="") |
| | 初始化 WeChatQRCode。它包含两个以 caffe 格式打包的模型,因此有 prototxt 和 caffe 模型(总共四个参数)。
|
| |
| | ~WeChatQRCode () |
| |
| std::vector< std::string > | detectAndDecode (InputArray img, OutputArrayOfArrays points=noArray()) |
| | 同时检测和解码 QR 码。为简化使用,提供了一个 API:detectAndDecode。
|
| |
| float | getScaleFactor () |
| |
| void | setScaleFactor (float _scalingFactor) |
| | 设置缩放因子。QR 码检测器使用神经网络检测 QR 码。在运行神经网络之前,输入图像会通过缩放进行预处理。默认情况下,输入图像会被缩放到面积为 160000 像素的图像。缩放因子允许自定义输入图像的缩放:width = scaleFactor*width height = scaleFactor*width
|
| |
WeChatQRCode 包含两个基于 CNN 的模型:一个对象检测模型和一个超分辨率模型。对象检测模型用于通过边界框检测 QR 码。超分辨率模型用于放大较小的 QR 码。
◆ WeChatQRCode()
| cv::wechat_qrcode::WeChatQRCode::WeChatQRCode |
( |
const std::string & | detector_prototxt_path = "", |
|
|
const std::string & | detector_caffe_model_path = "", |
|
|
const std::string & | super_resolution_prototxt_path = "", |
|
|
const std::string & | super_resolution_caffe_model_path = "" ) |
| Python |
|---|
| cv.wechat_qrcode.WeChatQRCode( | [, detector_prototxt_path[, detector_caffe_model_path[, super_resolution_prototxt_path[, super_resolution_caffe_model_path]]]] | ) -> | <wechat_qrcode_WeChatQRCode 对象> |
初始化 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()
| cv::wechat_qrcode::WeChatQRCode::~WeChatQRCode |
( |
| ) |
|
|
内联 |
◆ detectAndDecode()
| Python |
|---|
| cv.wechat_qrcode.WeChatQRCode.detectAndDecode( | img[, points] | ) -> | 返回值, points |
同时检测和解码 QR 码。为简化使用,提供了一个 API:detectAndDecode。
- 参数
-
| img | 支持灰度或彩色(BGR)图像。 |
| points | 可选的已找到 QR 码四边形顶点的输出数组。如果未找到,则为空。 |
- 返回
- 解码字符串列表。
◆ getScaleFactor()
| float cv::wechat_qrcode::WeChatQRCode::getScaleFactor |
( |
| ) |
|
| Python |
|---|
| cv.wechat_qrcode.WeChatQRCode.getScaleFactor( | | ) -> | retval |
◆ setScaleFactor()
| void cv::wechat_qrcode::WeChatQRCode::setScaleFactor |
( |
float | _scalingFactor | ) |
|
| Python |
|---|
| cv.wechat_qrcode.WeChatQRCode.setScaleFactor( | _scalingFactor | ) -> | None |
设置缩放因子。QR 码检测器使用神经网络检测 QR 码。在运行神经网络之前,输入图像会通过缩放进行预处理。默认情况下,输入图像会被缩放到面积为 160000 像素的图像。缩放因子允许自定义输入图像的缩放:width = scaleFactor*width height = scaleFactor*width
scaleFactor 的值必须大于 0 且小于等于 1,否则 scaleFactor 的值将设置为 -1,并使用默认值缩放到面积为 160000 像素的图像。
| Ptr<Impl> cv::wechat_qrcode::WeChatQRCode::p |
|
保护 |
该类的文档由以下文件生成: