View Source Evision.WeChatQRCode.WeChatQRCode (Evision v1.0.0-rc.0)
Summary
Functions
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
getScaleFactor
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 = scaleFactorwidth height = scaleFactorwidth
Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.
Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.
Types
@type t() :: %Evision.WeChatQRCode.WeChatQRCode{ref: reference()}
Type that represents an WeChatQRCode.WeChatQRCode struct.
ref.
reference()The underlying erlang resource variable.
Functions
@spec detectAndDecode(t(), Evision.Mat.maybe_mat_in()) :: {[binary()], [Evision.Mat.t()]} | {:error, String.t()}
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
Positional Arguments
self:
Evision.WeChatQRCode.WeChatQRCode.t()img:
Evision.Mat.supports grayscale or color (BGR) image.
Return
retval:
[string]points:
[Evision.Mat].optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
@return list of decoded string.
Python prototype (for reference only):
detectAndDecode(img[, points]) -> retval, points
@spec detectAndDecode(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) :: {[binary()], [Evision.Mat.t()]} | {:error, String.t()}
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
Positional Arguments
self:
Evision.WeChatQRCode.WeChatQRCode.t()img:
Evision.Mat.supports grayscale or color (BGR) image.
Return
retval:
[string]points:
[Evision.Mat].optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
@return list of decoded string.
Python prototype (for reference only):
detectAndDecode(img[, points]) -> retval, points
@spec getScaleFactor(Keyword.t()) :: any() | {:error, String.t()}
@spec getScaleFactor(t()) :: number() | {:error, String.t()}
getScaleFactor
Positional Arguments
- self:
Evision.WeChatQRCode.WeChatQRCode.t()
Return
- retval:
float
Python prototype (for reference only):
getScaleFactor() -> retval
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 = scaleFactorwidth height = scaleFactorwidth
Positional Arguments
- self:
Evision.WeChatQRCode.WeChatQRCode.t() - scalingFactor:
float
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.
Python prototype (for reference only):
setScaleFactor(_scalingFactor) -> None
Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.
Keyword Arguments
detector_model_path:
string.onnx model file path for the detector
super_resolution_model_path:
string.onnx model file path for the super resolution model
Return
- self:
Evision.WeChatQRCode.WeChatQRCode.t()
Python prototype (for reference only):
WeChatQRCode([, detector_model_path[, super_resolution_model_path]]) -> <wechat_qrcode_WeChatQRCode object>
@spec weChatQRCode(Keyword.t()) :: any() | {:error, String.t()}
@spec weChatQRCode( [detector_model_path: term(), super_resolution_model_path: term()] | nil ) :: t() | {:error, String.t()}
Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.
Keyword Arguments
detector_model_path:
string.onnx model file path for the detector
super_resolution_model_path:
string.onnx model file path for the super resolution model
Return
- self:
Evision.WeChatQRCode.WeChatQRCode.t()
Python prototype (for reference only):
WeChatQRCode([, detector_model_path[, super_resolution_model_path]]) -> <wechat_qrcode_WeChatQRCode object>