wasmCV is a WebAssembly guest module interface for computer vision based on OpenCV.
- Imports:
- interface
wasm:cv/types
- interface
wasm:cv/mat
- interface
wasm:cv/cv
- interface
wasm:cv/dnn
- interface
wasm:cv/objdetect
- interface
wasm:cv/features2d
- interface
- Exports:
- interface
wasm:cv/request
- interface
Import interface wasm:cv/types
Types
record size
size is a 2-element integer vector. It represents a width and height.
Record Fields
x
:s32
y
:s32
type point
record scalar
scalar is a 4-element floating point vector.
Record Fields
val1
:f32
val2
:f32
val3
:f32
val4
:f32
record rect
rect is a rectangle with integer coordinates. It is represented by the top-left corner and the bottom-right corner.
Record Fields
record RGBA
RGBA is a color with red, green, blue, and alpha channels.
Record Fields
r
:u8
g
:u8
b
:u8
a
:u8
enum border-type
border-type is a type of border to add to an image.
Enum Cases
border-constant
border-replicate
border-reflect
border-wrap
border-reflect101
border-transparent
border-default
border-isolated
enum adaptive-threshold-type
adaptive-threshold-type is a type of adaptive thresholding.
Enum Cases
adaptive-threshold-mean
adaptive-threshold-gaussian
enum threshold-type
threshold-type is a type of thresholding.
Enum Cases
threshold-binary
threshold-binary-inv
threshold-trunc
threshold-to-zero
threshold-to-zero-inv
threshold-mask
threshold-otsu
tthreshold-triangle
enum data-layout-type
data-layout-type is a type of data layout.
Enum Cases
data-layout-unknown
data-layout-nd
data-layout-nchw
data-layout-ncdhw
data-layout-nhwc
data-layout-ndhwc
data-layout-planar
enum padding-mode-type
Enum Cases
padding-mode-null
padding-mode-crop-center
padding-mode-letterbox
record blob-params
Record Fields
scale-factor
:f32
size
:size
mean
:scalar
swap-RB
:bool
ddepth
:u8
data-layout
:data-layout-type
padding-mode
:padding-mode-type
border
:scalar
record mix-max-loc-result
Record Fields
enum hershey-font-type
Enum Cases
hershey-font-simplex
hershey-font-plain
hershey-font-duplex
hershey-font-complex
hershey-font-triplex
hershey-font-complex-small
hershey-font-script-simplex
hershey-font-script-complex
hershey-font-italic
enum interpolation-type
Enum Cases
interpolation-nearest
interpolation-linear
interpolation-cubic
interpolation-area
interpolation-lanczos4
enum color-coversion-type
Enum Cases
color-BGR-to-BGRA
color-RGB-to-RGBA
color-BGRA-to-BGR
color-RGBA-to-RGB
color-BGR-to-RGBA
color-RGB-to-BGRA
color-RGBA-to-BGR
color-BGRA-to-RGB
color-BGR-to-RGB
color-RGB-to-BGR
color-BGRA-to-RGBA
color-RGBA-to-BGRA
color-BGR-to-gray
color-RGB-to-gray
color-gray-to-BGR
color-gray-to-RGB
color-gray-to-BGRA
color-gray-to-RGBA
color-BGRA-to-gray
color-RGBA-to-gray
enum morph-shape
Enum Cases
morph-rect
morph-cross
morph-ellipse
record key-point
Record Fields
x
:f32
y
:f32
size
:f32
angle
:f32
response
:f32
octave
:s32
class-id
:s32
record d-match
DMatch is data structure for matching keypoint descriptors.
For further details, please see: https://docs.opencv.org/4.x/d4/de0/classcv_1_1DMatch.html#a546ddb9a87898f06e510e015a6de596e
Record Fields
query-idx
:u32
train-idx
:u32
img-idx
:u32
distance
:f64
Import interface wasm:cv/mat
mat resource is a matrix of bytes, wrapper around the cv::Mat type.
Types
type mix-max-loc-result
Enum Cases
cv8u
cv8s
cv16u
cv16s
cv32s
cv32f
cv64f
resource mat
Functions
[constructor]mat: func
Create a new Mat. id does not currently do anything.
Params
id
:u32
Return values
- own<
mat
>
[static]mat.new-with-size: func
Create a new Mat with the specified size and type.
Params
cols
:u32
rows
:u32
mattype
:mattype
Return values
- own<
mat
>
[method]mat.clone: func
Clone returns a cloned full copy of the Mat.
Params
self
: borrow<mat
>
Return values
- own<
mat
>
[method]mat.close: func
Close the Mat
Params
self
: borrow<mat
>
[method]mat.cols: func
Cols returns the number of columns for this Mat.
Params
self
: borrow<mat
>
Return values
u32
[method]mat.rows: func
Rows returns the number of rows for this Mat.
Params
self
: borrow<mat
>
Return values
u32
[method]mat.region: func
Region returns a new Mat that points to a region of this Mat. Changes made to the region Mat will affect the original Mat, since they are pointers to the underlying OpenCV Mat object.
Params
Return values
- own<
mat
>
[method]mat.copy-to: func
CopyTo copies Mat into destination Mat.
Params
[method]mat.convert-to: func
ConvertTo converts Mat into destination Mat.
Params
Return values
- own<
mat
>
[method]mat.mattype: func
MatType returns the type of the Mat.
Params
self
: borrow<mat
>
Return values
[method]mat.size: func
Size returns an array with one element for each dimension containing the size of that dimension for the Mat.
Params
self
: borrow<mat
>
Return values
- list<
u32
>
[method]mat.step: func
Step returns the number of bytes each matrix row occupies.
Params
self
: borrow<mat
>
Return values
u32
[method]mat.elemsize: func
ElemSize returns the matrix element size in bytes.
Params
self
: borrow<mat
>
Return values
u32
[method]mat.empty: func
Empty returns true if the Mat is empty.
Params
self
: borrow<mat
>
Return values
bool
[method]mat.get-float-at: func
GetFloatAt returns the value at the specified row and column as a f32.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
f32
[method]mat.set-float-at: func
SetFloatAt sets the value at the specified row and column as a f32.
Params
self
: borrow<mat
>row
:u32
col
:u32
val
:f32
[method]mat.get-uchar-at: func
GetUCharAt returns the value at the specified row and column as a u8.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
u8
[method]mat.set-uchar-at: func
SetUCharAt sets the value at the specified row and column as a u8.
Params
self
: borrow<mat
>row
:u32
col
:u32
val
:u8
[method]mat.get-int-at: func
GetIntAt returns the value at the specified row and column as a s32.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
s32
[method]mat.set-int-at: func
SetIntAt sets the value at the specified row and column as a s32.
Params
self
: borrow<mat
>row
:u32
col
:u32
val
:s32
[method]mat.get-float-at3: func
GetFloatAt3 returns the value at the specified x, y, z as a f32.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
Return values
f32
[method]mat.set-float-at3: func
SetFloatAt3 sets the value at the specified x, y, z as a f32.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
val
:f32
[method]mat.get-uchar-at3: func
GetUCharAt3 returns the value at the specified x, y, z as a u8.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
Return values
u8
[method]mat.set-uchar-at3: func
SetUCharAt3 sets the value at the specified x, y, z as a u8.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
val
:u8
[method]mat.get-int-at3: func
GetIntAt3 returns the value at the specified x, y, z as a s32.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
Return values
s32
[method]mat.set-int-at3: func
SetIntAt3 sets the value at the specified x, y, z as a s32.
Params
self
: borrow<mat
>x
:u32
y
:u32
z
:u32
val
:s32
[method]mat.get-vecb-at: func
GetVecbAt returns a vector of bytes. Its size corresponds to the number of channels of the Mat.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
- list<
u8
>
[method]mat.get-vecf-at: func
GetVecfAt returns a vector of floats. Its size corresponds to the number of channels of the Mat.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
- list<
f32
>
[method]mat.get-veci-at: func
GetVeciAt returns a vector of s32. Its size corresponds to the number of channels of the Mat.
Params
self
: borrow<mat
>row
:u32
col
:u32
Return values
- list<
s32
>
[method]mat.reshape: func
Reshape changes the shape and/or the number of channels of a 2D matrix without copying the data.
For further details, please see: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a4eb96e3251417fa88b78e2abd6cfd7d8
Params
self
: borrow<mat
>channels
:u32
rows
:u32
Return values
- own<
mat
>
[method]mat.row-range: func
RowRange creates a matrix header for the specified row span.
For further details, please see: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#aa6542193430356ad631a9beabc624107
Params
self
: borrow<mat
>start
:u32
end
:u32
Return values
- own<
mat
>
[method]mat.col-range: func
ColRange creates a matrix header for the specified column span.
For further details, please see: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#aadc8f9210fe4dec50513746c246fa8d9
Params
self
: borrow<mat
>start
:u32
end
:u32
Return values
- own<
mat
>
[method]mat.min-max-loc: func
MinMaxLoc finds the global minimum and maximum in an array.
For further details, please see: https://docs.opencv.org/trunk/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707
Params
self
: borrow<mat
>
Return values
[method]mat.col: func
col creates a matrix header for the specified matrix column. The underlying data of the new matrix is shared with the original matrix.
Params
self
: borrow<mat
>col
:u32
Return values
- own<
mat
>
[method]mat.row: func
row creates a matrix header for the specified matrix row. The underlying data of the new matrix is shared with the original matrix.
Params
self
: borrow<mat
>row
:u32
Return values
- own<
mat
>
[static]mat.merge: func
Merge creates one multi-channel array out of several single-channel ones.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4
Params
mv
: list<own<mat
»
Return values
- own<
mat
>
[static]mat.zeros: func
zeros returns a zero array of the specified size and type.
Params
cols
:u32
rows
:u32
mattype
:mattype
Return values
- own<
mat
>
Import interface wasm:cv/cv
Types
type border-type
Functions
arrowed-line: func
drawing functions ArrowedLine draws a arrow segment pointing from the first point to the second one.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2
Params
rectangle: func
Rectangle draws a simple, thick, or filled up-right rectangle.
For further details, please see: https://docs.opencv.org/4.x/d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8f3d1e1b7
Params
circle: func
Circle draws a circle.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670
Params
line: func
Line draws a line segment connecting two points.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2
Params
put-text: func
PutText draws a text string. It renders the specified text string into the img Mat at the location passed in the “org” param, using the desired font face, font scale, color, and line thinkness.
For further details, please see: http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576
Params
img
: borrow<mat
>text
:string
org
:point
font-face
:hershey-font-type
font-scale
:f64
c
:RGBA
thickness
:s32
adaptive-threshold: func
imgproc functions AdaptiveThreshold applies a fixed-level threshold to each array element.
For further details, please see: https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3
Params
src
: own<mat
>max-value
:f32
adaptive-type
:adaptive-threshold-type
threshold-type
:threshold-type
block-size
:u32
c
:f32
Return values
- own<
mat
>
blur: func
Blur blurs an image Mat using a normalized box filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37
Params
Return values
- own<
mat
>
box-filter: func
BoxFilter blurs an image using the box filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3
Params
Return values
- own<
mat
>
canny: func
Canny finds edges in an image using the Canny algorithm. The function finds edges in the input image image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See http://en.wikipedia.org/wiki/Canny_edge_detector
For further details, please see: http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de
Params
src
: own<mat
>threshold1
:f32
threshold2
:f32
Return values
- own<
mat
>
cvt-color: func
CvtColor converts an image from one color space to another.
For further details, please see: http://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
Params
src
: own<mat
>code
:color-coversion-type
Return values
- own<
mat
>
dilate: func
Dilate dilates an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c
Params
Return values
- own<
mat
>
erode: func
Erode erodes an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb
Params
Return values
- own<
mat
>
equalize-hist: func
EqualizeHist normalizes the brightness and increases the contrast of the image.
For further details, please see: https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga7e54091f0c937d49bf84152a16f76d6e
Params
src
: own<mat
>
Return values
- own<
mat
>
gaussian-blur: func
GaussianBlur blurs an image using a Gaussian filter.
For further details, please see: https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#gae8bdcd9154ed5ca3cbc1766d960f45c1
Params
src
: own<mat
>size
:size
sigma-x
:f32
sigma-y
:f32
border
:border-type
Return values
- own<
mat
>
get-structuring-element: func
GetStructuringElement returns a structuring element of the specified size and shape for morphological operations.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc
Params
shape
:morph-shape
size
:size
Return values
- own<
mat
>
hough-lines: func
HoughLines implements the standard or standard multi-scale Hough transform algorithm for line detection. For a good explanation of Hough transform, see: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
For further details, please see: http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a
Params
src
: own<mat
>rho
:f64
theta
:f64
threshold
:s32
Return values
- own<
mat
>
hough-lines-p: func
HoughLinesP implements the probabilistic Hough transform algorithm for line detection. For a good explanation of Hough transform, see: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
For further details, please see: http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb
Params
src
: own<mat
>rho
:f64
theta
:f64
threshold
:s32
Return values
- own<
mat
>
median-blur: func
MedianBlur blurs an image using the median filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
Params
Return values
- own<
mat
>
resize: func
Resize resizes an image. It resizes the image src down to or up to the specified size, storing the result in dst. Note that src and dst may be the same image. If you wish to scale by factor, an empty sz may be passed and non-zero fx and fy. Likewise, if you wish to scale to an explicit size, a non-empty sz may be passed with zero for both fx and fy.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
Params
src
: own<mat
>size
:size
fx
:f32
fy
:f32
interp
:interpolation-type
Return values
- own<
mat
>
threshold: func
Threshold applies a fixed-level threshold to each array element.
For further details, please see: https://docs.opencv.org/3.3.0/d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57
Params
src
: own<mat
>thresh
:f32
max-value
:f32
threshold-type
:threshold-type
Return values
- own<
mat
>
transpose-ND: func
Transpose for n-dimensional matrices.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab1b1274b4a563be34cdfa55b8919a4ec
Params
src
: own<mat
>order
: list<s32
>
Return values
- own<
mat
>
estimate-affine2d: func
estimate-affine2d computes an optimal affine transformation between two 2D point sets.
For further details, please see: https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga27865b1d26bac9ce91efaee83e94d4dd
Params
Return values
- own<
mat
>
warp-affine: func
warp-affine applies an affine transformation to an image.
For further details, please see: https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
Params
Return values
- own<
mat
>
get-rotation-matrix2d: func
get-rotation-matrix2d calculates an affine matrix of 2D rotation.
For further details, please see: https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326
Params
center
:point
angle
:f64
scale
:f64
Return values
- own<
mat
>
add: func
add calculates the per-element sum of two arrays.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6
Params
Return values
- own<
mat
>
add-weighted: func
add-weighted calculates the weighted sum of two arrays.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19
Params
Return values
- own<
mat
>
exp: func
exp calculates the exponent of every array element.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga3e10108e2162c338f1b848af619f39e5
Params
src
: own<mat
>
Return values
- own<
mat
>
hconcat: func
hconcat applies horizontal concatenation to given matrices.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gaab5ceee39e0580f879df645a872c6bf7
Params
Return values
- own<
mat
>
vconcat: func
vconcat applies vertical concatenation to given matrices.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga744f53b69f6e4f12156cdde4e76aed27
Params
Return values
- own<
mat
>
lut: func
lut performs a look-up table transform of an array.
The function LUT fills the output array with values from the look-up table. Indices of the entries are taken from the input array.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab55b8d062b7f5587720ede032d34156f
Params
Return values
- own<
mat
>
reduce-arg-max: func
reduce-arg-max finds indices of max elements along provided axis.
For further details, please see: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gaa87ea34d99bcc5bf9695048355163da0
Params
src
: own<mat
>axis
:u32
last-index
:bool
Return values
- own<
mat
>
Import interface wasm:cv/dnn
Types
type mat
Enum Cases
net-backend-default
net-backend-halide
net-backend-openvino
net-backend-opencv
net-backend-vkcom
net-backend-cuda
enum net-target-type
Enum Cases
net-target-cpu
net-target-fp32
net-target-fp16
net-target-vpu
net-target-vulkan
net-target-fpga
net-target-cuda
net-target-cuda-fp16
resource layer
resource net
Functions
[constructor]layer: func
Return values
- own<
layer
>
[method]layer.get-name: func
GetName returns the name of the layer.
Params
self
: borrow<layer
>
Return values
string
[static]net.read: func
ReadNet read deep learning network represented in one of the supported formats.
For further details, please see: https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga138439da76f26266fdefec9723f6c5cd
Params
model
:string
config
:string
Return values
- own<
net
>
[static]net.read-from-ONNX: func
ReadNetFromONNX reads a network model stored in ONNX framework’s format.
For further details, please see: https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga9198ecaac7c32ddf0aa7a1bcbd359567
Params
model
:string
Return values
- own<
net
>
[method]net.close: func
Close the network
Params
self
: borrow<net
>
[method]net.empty: func
Empty returns true if there are no layers in the network.
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a6a5778787d5b8770deab5eda6968e66c
Params
self
: borrow<net
>
Return values
bool
[method]net.set-input: func
SetInput sets the new input value for the network.
For further details, please see: https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a672a08ae76444d75d05d7bfea3e4a328
Params
[method]net.forward: func
Forward runs forward pass to compute output of layer with name outputName.
For further details, please see: https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a98ed94cb6ef7063d3697259566da310b
Params
self
: borrow<net
>output-name
:string
Return values
- own<
mat
>
[method]net.forward-layers: func
ForwardLayers forward pass to compute outputs of layers listed in outBlobNames.
For further details, please see: https://docs.opencv.org/4.x/db/d30/classcv_1_1dnn_1_1Net.html#afe22e099b60a2883e220645391f68d4c
Params
self
: borrow<net
>output-names
: list<string
>
Return values
- list<own<
mat
»
[method]net.get-unconnected-out-layers: func
GetUnconnectedOutLayers returns indexes of layers with unconnected outputs.
For further details, please see: https://docs.opencv.org/4.x/db/d30/classcv_1_1dnn_1_1Net.html#ae26f0c29b3733d15d0482098ef9053e3
Params
self
: borrow<net
>
Return values
- list<
u32
>
[method]net.get-layer-names: func
GetLayerNames returns names of layers in the network.
For further details, please see: hhttps://docs.opencv.org/4.x/db/d30/classcv_1_1dnn_1_1Net.html#a38e67098ae4ae5906bf8d8ea72199c2e
Params
self
: borrow<net
>
Return values
- list<
string
>
[method]net.get-layer: func
GetLayer returns layer with specified id.
For further details, please see: https://docs.opencv.org/4.x/db/d30/classcv_1_1dnn_1_1Net.html#ac944d7f2d3ead5ef9b1b2fa3885f3ff1
Params
self
: borrow<net
>id
:u32
Return values
- own<
layer
>
blob-from-image: func
BlobFromImage creates 4-dimensional blob from image. Optionally resizes and crops image from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels.
For further details, please see: https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga29f34df9376379a603acd8df581ac8d7
Params
Return values
- own<
mat
>
blob-from-image-with-params: func
BlobFromImageWithParams creates 4-dimensional blob from image. Optionally resizes and crops image from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels.
For further details, please see: https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga29f34df9376379a603acd8df581ac8d7
Params
image
: own<mat
>params
:blob-params
Return values
- own<
mat
>
blob-rects-to-image-rects: func
BlobRectsToImageRects converts blob rects to image rects.
For further details, please see: https://docs.opencv.org/4.4.0/d6/d0f/group__dnn.html#ga9d118d70a1659af729d01b10233213ee
Params
params
:blob-params
blob-rects
: list<rect
>image-size
:size
Return values
- list<
rect
>
NMS-boxes: func
NMSBoxes performs non maximum suppression given boxes and corresponding scores.
For futher details, please see: https://docs.opencv.org/4.4.0/d6/d0f/group__dnn.html#ga9d118d70a1659af729d01b10233213ee
Params
bboxes
: list<rect
>scores
: list<f32
>score-threshold
:f32
nms-threshold
:f32
Return values
- list<
s32
>
Import interface wasm:cv/objdetect
Types
type mat
CascadeClassifier is a cascade classifier class for object detection.
resource HOG-descriptor
HOGDescriptor is a Histogram Of Gradiants (HOG) for object detection.
For further details, please see: https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8
resource face-detector-YN
enum face-distance-type
Enum Cases
face-distance-type-cosine
face-distance-norm-l2
resource face-recognizer-SF
Functions
[constructor]cascade-classifier: func
NewCascadeClassifier returns a new CascadeClassifier.
For further details, please see: https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516
Params
name
:string
Return values
- own<
cascade-classifier
>
[method]cascade-classifier.close: func
Close the CascadeClassifier
Params
self
: borrow<cascade-classifier
>
[method]cascade-classifier.load: func
Load cascade classifier from a file.
For further details, please see: http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#a1a5884c8cc749422f9eb77c2471958bc
Params
self
: borrow<cascade-classifier
>file
:string
Return values
bool
[method]cascade-classifier.detect-multi-scale: func
DetectMultiScale detects objects of different sizes in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
Params
self
: borrow<cascade-classifier
>image
: own<mat
>
Return values
- list<
rect
>
[method]cascade-classifier.detect-multi-scale-with-params: func
DetectMultiScaleWithParams detects objects of different sizes in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
Params
self
: borrow<cascade-classifier
>image
: own<mat
>scale
:f64
min-neighbors
:u32
flags
:u32
min-size
:size
max-size
:size
Return values
- list<
rect
>
[constructor]HOG-descriptor: func
NewHOGDescriptor returns a new HOGDescriptor.
Params
name
:string
Return values
- own<
HOG-descriptor
>
[method]HOG-descriptor.close: func
Close the HOGDescriptor
Params
self
: borrow<HOG-descriptor
>
[method]HOG-descriptor.detect-multi-scale: func
DetectMultiScale detects objects of different sizes in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
Params
self
: borrow<HOG-descriptor
>image
: own<mat
>
Return values
- list<
rect
>
[method]HOG-descriptor.detect-multi-scale-with-params: func
DetectMultiScaleWithParams detects objects of different sizes in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
Params
self
: borrow<HOG-descriptor
>image
: own<mat
>hit-threshold
:f64
win-stride
:size
padding
:size
scale
:f64
final-threshold
:f64
use-meanshift-grouping
:bool
Return values
- list<
rect
>
[constructor]face-detector-YN: func
Creates an instance of face detector YN with given parameters.
For further details, please see: https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516
Params
model
:string
config
:string
input-size
:size
Return values
- own<
face-detector-YN
>
[static]face-detector-YN.new-with-params: func
Creates an instance of face detector YN with given parameters.
For further details, please see: https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516
Params
model
:string
config
:string
input-size
:size
score-threshold
:f32
nms-threshold
:f32
top-k
:u32
backend-id
:u32
target-id
:u32
Return values
- own<
face-detector-YN
>
[method]face-detector-YN.close: func
Close the face detector
Params
self
: borrow<face-detector-YN
>
[method]face-detector-YN.detect: func
Detects faces in the input image.
For further details, please see: https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#ac05bd075ca3e6edc0e328927aae6f45b
Params
self
: borrow<face-detector-YN
>input
: own<mat
>
Return values
- own<
mat
>
[method]face-detector-YN.get-input-size: func
Params
self
: borrow<face-detector-YN
>
Return values
[method]face-detector-YN.get-nms-threshold: func
Params
self
: borrow<face-detector-YN
>
Return values
f32
[method]face-detector-YN.get-score-threshold: func
Params
self
: borrow<face-detector-YN
>
Return values
f32
[method]face-detector-YN.get-topk: func
Params
self
: borrow<face-detector-YN
>
Return values
u32
[method]face-detector-YN.set-input-size: func
Params
self
: borrow<face-detector-YN
>size
:size
[method]face-detector-YN.set-nms-threshold: func
Params
self
: borrow<face-detector-YN
>threshold
:f32
[method]face-detector-YN.set-score-threshold: func
Params
self
: borrow<face-detector-YN
>threshold
:f32
[method]face-detector-YN.set-topk: func
Params
self
: borrow<face-detector-YN
>topk
:u32
[constructor]face-recognizer-SF: func
Creates an instance of FaceRecognizerSF with given parameters.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a04df90b0cd7d26d350acd92621a35743
Params
model
:string
config
:string
Return values
- own<
face-recognizer-SF
>
[static]face-recognizer-SF.new-with-params: func
Creates an instance of FaceRecognizerSF with given parameters.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a04df90b0cd7d26d350acd92621a35743
Params
model
:string
config
:string
backend-id
:u32
target-id
:u32
Return values
- own<
face-recognizer-SF
>
[method]face-recognizer-SF.close: func
Close the face FaceRecognizerSF
Params
self
: borrow<face-recognizer-SF
>
[method]face-recognizer-SF.align-crop: func
Aligns detected face with the source input image and crops it.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a84492908abecbc9362b4ddc8d46b8345
Params
self
: borrow<face-recognizer-SF
>src
: own<mat
>face-box
: own<mat
>
Return values
- own<
mat
>
[method]face-recognizer-SF.feature: func
Feature extracts face feature from aligned image.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#ab1b4a3c12213e89091a490c573dc5aba
Params
self
: borrow<face-recognizer-SF
>aligned
: own<mat
>
Return values
- own<
mat
>
[method]face-recognizer-SF.match: func
Match calculates the distance between two face features.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a2f0362ca1e64320a1f3ba7e1386d0219
Params
self
: borrow<face-recognizer-SF
>face1
: own<mat
>face2
: own<mat
>
Return values
f32
[method]face-recognizer-SF.match-with-params: func
Match calculates the distance between two face features.
For further details, please see: https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a2f0362ca1e64320a1f3ba7e1386d0219
Params
self
: borrow<face-recognizer-SF
>face1
: own<mat
>face2
: own<mat
>distance
:face-distance-type
Return values
f32
Import interface wasm:cv/features2d
Types
type mat
detector-result returns the keypoints and descripts for a detector.
Record Fields
resource AKAZE-detector
AKAZE-detector is a wrapper around the cv::AKAZE algorithm.
resource BRISK-detector
BRISK-detector is a wrapper around the cv::BRISK algorithm.
resource KAZE-detector
KAZE-detector is a wrapper around the cv::KAZE algorithm.
enum ORB-score-type
Enum Cases
ORB-HARRIS
ORB-FAST
resource ORB-detector
ORB-detector is a wrapper around the cv::ORB algorithm.
resource SIFT-detector
SIFT-detector is a wrapper around the cv::SIFT algorithm.
enum norm-type
Enum Cases
NORM-NONE
NONE-INF
NORM-L1
NORM-NONE2
NORM-L2
NORM-L2SQR
NORM-HAMMING
NORM-HAMMING2
NORM-RELATIVE
resource BF-matcher
BF-matcher is a wrapper around the cv::BFMatcher algorithm.
resource flann-based-matcher
Flann-based-matcher is a wrapper around the cv::BFMatcher algorithm.
Functions
[constructor]AKAZE-detector: func
Returns a new akaze-detector.
For further details, please see: https://docs.opencv.org/4.x/d8/d30/classcv_1_1AKAZE.html
Params
name
:string
Return values
- own<
AKAZE-detector
>
[method]AKAZE-detector.close: func
Close the akaze-detector
Params
self
: borrow<AKAZE-detector
>
[method]AKAZE-detector.detect: func
Detect keypoints in an image using AKAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
Params
self
: borrow<AKAZE-detector
>src
: own<mat
>
Return values
- list<
key-point
>
[method]AKAZE-detector.compute: func
Compute keypoints in an image using AKAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0
Params
self
: borrow<AKAZE-detector
>src
: own<mat
>mask
: own<mat
>kps
: list<key-point
>
Return values
[method]AKAZE-detector.detect-and-compute: func
DetectAndCompute keypoints and compute in an image using AKAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
Params
self
: borrow<AKAZE-detector
>src
: own<mat
>mask
: own<mat
>
Return values
[constructor]BRISK-detector: func
Returns a new BRISK-detector.
For further details, please see: https://docs.opencv.org/4.x/de/dbf/classcv_1_1BRISK.html
Params
name
:string
Return values
- own<
BRISK-detector
>
[method]BRISK-detector.close: func
Close the BRISK-detector
Params
self
: borrow<BRISK-detector
>
[method]BRISK-detector.detect: func
Detect keypoints in an image using BRISK.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
Params
self
: borrow<BRISK-detector
>src
: own<mat
>
Return values
- list<
key-point
>
[method]BRISK-detector.compute: func
Compute keypoints in an image using BRISK.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0
Params
self
: borrow<BRISK-detector
>src
: own<mat
>mask
: own<mat
>kps
: list<key-point
>
Return values
[method]BRISK-detector.detect-and-compute: func
DetectAndCompute keypoints and compute in an image using BRISK.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
Params
self
: borrow<BRISK-detector
>src
: own<mat
>mask
: own<mat
>
Return values
[constructor]KAZE-detector: func
Returns a new KAZE-detector.
For further details, please see: https://docs.opencv.org/4.x/d3/d61/classcv_1_1KAZE.html
Params
name
:string
Return values
- own<
KAZE-detector
>
[method]KAZE-detector.close: func
Close the KAZE-detector
Params
self
: borrow<KAZE-detector
>
[method]KAZE-detector.detect: func
Detect keypoints in an image using KAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
Params
self
: borrow<KAZE-detector
>src
: own<mat
>
Return values
- list<
key-point
>
[method]KAZE-detector.compute: func
Compute keypoints in an image using KAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0
Params
self
: borrow<KAZE-detector
>src
: own<mat
>mask
: own<mat
>kps
: list<key-point
>
Return values
[method]KAZE-detector.detect-and-compute: func
DetectAndCompute keypoints and compute in an image using KAZE.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
Params
self
: borrow<KAZE-detector
>src
: own<mat
>mask
: own<mat
>
Return values
[constructor]ORB-detector: func
Returns a new ORB-detector.
For further details, please see: https://docs.opencv.org/4.x/db/d95/classcv_1_1ORB.html
Params
name
:string
Return values
- own<
ORB-detector
>
[static]ORB-detector.new-with-params: func
Returns a new ORB-detector.
For further details, please see: https://docs.opencv.org/4.x/db/d95/classcv_1_1ORB.html
Params
features
:u32
scale
:f32
levels
:u32
edge-threshold
:u32
first
:u32
WTAK
:u32
score-type
:ORB-score-type
patch-size
:u32
fast-threshold
:u32
Return values
- own<
ORB-detector
>
[method]ORB-detector.close: func
Close the ORB-detector
Params
self
: borrow<ORB-detector
>
[method]ORB-detector.detect: func
Detect keypoints in an image using ORB.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
Params
self
: borrow<ORB-detector
>src
: own<mat
>
Return values
- list<
key-point
>
[method]ORB-detector.compute: func
Compute keypoints in an image using ORB.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0
Params
self
: borrow<ORB-detector
>src
: own<mat
>mask
: own<mat
>kps
: list<key-point
>
Return values
[method]ORB-detector.detect-and-compute: func
DetectAndCompute keypoints and compute in an image using ORB.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
Params
self
: borrow<ORB-detector
>src
: own<mat
>mask
: own<mat
>
Return values
[constructor]SIFT-detector: func
Returns a new SIFT-detector.
For further details, please see: https://docs.opencv.org/4.x/d7/d60/classcv_1_1SIFT.html
Params
name
:string
Return values
- own<
SIFT-detector
>
[method]SIFT-detector.close: func
Close the SIFT-detector
Params
self
: borrow<SIFT-detector
>
[method]SIFT-detector.detect: func
Detect keypoints in an image using SIFT.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
Params
self
: borrow<SIFT-detector
>src
: own<mat
>
Return values
- list<
key-point
>
[method]SIFT-detector.compute: func
Compute keypoints in an image using SIFT.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0
Params
self
: borrow<SIFT-detector
>src
: own<mat
>mask
: own<mat
>kps
: list<key-point
>
Return values
[method]SIFT-detector.detect-and-compute: func
DetectAndCompute keypoints and compute in an image using SIFT.
For further details, please see: https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
Params
self
: borrow<SIFT-detector
>src
: own<mat
>mask
: own<mat
>
Return values
[constructor]BF-matcher: func
Returns a new BF-matcher.
For further details, please see: https://docs.opencv.org/4.x/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd
Params
name
:string
Return values
- own<
BF-matcher
>
[static]BF-matcher.new-with-params: func
Returns a new BF-matcher.
For further details, please see: https://docs.opencv.org/4.x/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd
Params
norm
:norm-type
cross-check
:bool
Return values
- own<
BF-matcher
>
[method]BF-matcher.close: func
Close the BF-matcher
Params
self
: borrow<BF-matcher
>
[method]BF-matcher.match: func
Match Finds the best match for each descriptor from a query set.
For further details, please see: https://docs.opencv.org/4.x/db/d39/classcv_1_1DescriptorMatcher.html#a0f046f47b68ec7074391e1e85c750cba
Params
self
: borrow<BF-matcher
>query
: own<mat
>train
: own<mat
>
Return values
- list<
d-match
>
[method]BF-matcher.KNN-match: func
KNNMatch finds the k best matches for each descriptor from a query set.
For further details, please see: https://docs.opencv.org/4.x/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a
Params
self
: borrow<BF-matcher
>query
: own<mat
>train
: own<mat
>k
:u32
Return values
- list<list<
d-match
»
[constructor]flann-based-matcher: func
Returns a new flann-based-matcher.
For further details, please see: https://docs.opencv.org/4.x/dc/de2/classcv_1_1FlannBasedMatcher.html#ab9114a6471e364ad221f89068ca21382
Params
name
:string
Return values
- own<
flann-based-matcher
>
[method]flann-based-matcher.close: func
Close the flann-based-matcher
Params
self
: borrow<flann-based-matcher
>
[method]flann-based-matcher.KNN-match: func
KNNMatch finds the k best matches for each descriptor from a query set.
For further details, please see: https://docs.opencv.org/4.x/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a
Params
self
: borrow<flann-based-matcher
>query
: own<mat
>train
: own<mat
>k
:u32
Return values
- list<list<
d-match
»
Export interface wasm:cv/request
Types
type mat
Functions
process: func
Params
image
: own<mat
>
Return values
- own<
mat
>