@techstark/opencv-js 4.8.0-release.6 → 4.8.0-release.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +18 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/_cv.d.ts +7 -0
- package/dist/src/types/_cv.js +3 -0
- package/dist/src/types/_cv.js.map +1 -0
- package/dist/src/types/emscripten.d.ts +166 -0
- package/dist/src/types/emscripten.js +4 -0
- package/dist/src/types/emscripten.js.map +1 -0
- package/dist/src/types/opencv/Affine3.d.ts +183 -0
- package/dist/src/types/opencv/Affine3.js +3 -0
- package/dist/src/types/opencv/Affine3.js.map +1 -0
- package/dist/src/types/opencv/Algorithm.d.ts +105 -0
- package/dist/src/types/opencv/Algorithm.js +4 -0
- package/dist/src/types/opencv/Algorithm.js.map +1 -0
- package/dist/src/types/opencv/AutoBuffer.d.ts +41 -0
- package/dist/src/types/opencv/AutoBuffer.js +3 -0
- package/dist/src/types/opencv/AutoBuffer.js.map +1 -0
- package/dist/src/types/opencv/BFMatcher.d.ts +33 -0
- package/dist/src/types/opencv/BFMatcher.js +3 -0
- package/dist/src/types/opencv/BFMatcher.js.map +1 -0
- package/dist/src/types/opencv/BOWTrainer.d.ts +36 -0
- package/dist/src/types/opencv/BOWTrainer.js +3 -0
- package/dist/src/types/opencv/BOWTrainer.js.map +1 -0
- package/dist/src/types/opencv/CascadeClassifier.d.ts +100 -0
- package/dist/src/types/opencv/CascadeClassifier.js +4 -0
- package/dist/src/types/opencv/CascadeClassifier.js.map +1 -0
- package/dist/src/types/opencv/DescriptorMatcher.d.ts +172 -0
- package/dist/src/types/opencv/DescriptorMatcher.js +3 -0
- package/dist/src/types/opencv/DescriptorMatcher.js.map +1 -0
- package/dist/src/types/opencv/DynamicBitset.d.ts +57 -0
- package/dist/src/types/opencv/DynamicBitset.js +3 -0
- package/dist/src/types/opencv/DynamicBitset.js.map +1 -0
- package/dist/src/types/opencv/Exception.d.ts +38 -0
- package/dist/src/types/opencv/Exception.js +3 -0
- package/dist/src/types/opencv/Exception.js.map +1 -0
- package/dist/src/types/opencv/Feature2D.d.ts +14 -0
- package/dist/src/types/opencv/Feature2D.js +4 -0
- package/dist/src/types/opencv/Feature2D.js.map +1 -0
- package/dist/src/types/opencv/FlannBasedMatcher.d.ts +41 -0
- package/dist/src/types/opencv/FlannBasedMatcher.js +3 -0
- package/dist/src/types/opencv/FlannBasedMatcher.js.map +1 -0
- package/dist/src/types/opencv/HOGDescriptor.d.ts +265 -0
- package/dist/src/types/opencv/HOGDescriptor.js +3 -0
- package/dist/src/types/opencv/HOGDescriptor.js.map +1 -0
- package/dist/src/types/opencv/Logger.d.ts +27 -0
- package/dist/src/types/opencv/Logger.js +3 -0
- package/dist/src/types/opencv/Logger.js.map +1 -0
- package/dist/src/types/opencv/LshTable.d.ts +67 -0
- package/dist/src/types/opencv/LshTable.js +3 -0
- package/dist/src/types/opencv/LshTable.js.map +1 -0
- package/dist/src/types/opencv/Mat.d.ts +1589 -0
- package/dist/src/types/opencv/Mat.js +3 -0
- package/dist/src/types/opencv/Mat.js.map +1 -0
- package/dist/src/types/opencv/MatExpr.d.ts +78 -0
- package/dist/src/types/opencv/MatExpr.js +4 -0
- package/dist/src/types/opencv/MatExpr.js.map +1 -0
- package/dist/src/types/opencv/MatOp.d.ts +29 -0
- package/dist/src/types/opencv/MatOp.js +3 -0
- package/dist/src/types/opencv/MatOp.js.map +1 -0
- package/dist/src/types/opencv/Matx.d.ts +84 -0
- package/dist/src/types/opencv/Matx.js +3 -0
- package/dist/src/types/opencv/Matx.js.map +1 -0
- package/dist/src/types/opencv/Node.d.ts +25 -0
- package/dist/src/types/opencv/Node.js +3 -0
- package/dist/src/types/opencv/Node.js.map +1 -0
- package/dist/src/types/opencv/ORB.d.ts +11 -0
- package/dist/src/types/opencv/ORB.js +4 -0
- package/dist/src/types/opencv/ORB.js.map +1 -0
- package/dist/src/types/opencv/PCA.d.ts +170 -0
- package/dist/src/types/opencv/PCA.js +3 -0
- package/dist/src/types/opencv/PCA.js.map +1 -0
- package/dist/src/types/opencv/RotatedRect.d.ts +63 -0
- package/dist/src/types/opencv/RotatedRect.js +3 -0
- package/dist/src/types/opencv/RotatedRect.js.map +1 -0
- package/dist/src/types/opencv/_hacks.d.ts +267 -0
- package/dist/src/types/opencv/_hacks.js +15 -0
- package/dist/src/types/opencv/_hacks.js.map +1 -0
- package/dist/src/types/opencv/_types.d.ts +44 -0
- package/dist/src/types/opencv/_types.js +61 -0
- package/dist/src/types/opencv/_types.js.map +1 -0
- package/dist/src/types/opencv/calib3d.d.ts +2180 -0
- package/dist/src/types/opencv/calib3d.js +3 -0
- package/dist/src/types/opencv/calib3d.js.map +1 -0
- package/dist/src/types/opencv/core_array.d.ts +2513 -0
- package/dist/src/types/opencv/core_array.js +3 -0
- package/dist/src/types/opencv/core_array.js.map +1 -0
- package/dist/src/types/opencv/core_cluster.d.ts +54 -0
- package/dist/src/types/opencv/core_cluster.js +3 -0
- package/dist/src/types/opencv/core_cluster.js.map +1 -0
- package/dist/src/types/opencv/core_hal_interface.d.ts +92 -0
- package/dist/src/types/opencv/core_hal_interface.js +3 -0
- package/dist/src/types/opencv/core_hal_interface.js.map +1 -0
- package/dist/src/types/opencv/core_utils.d.ts +510 -0
- package/dist/src/types/opencv/core_utils.js +3 -0
- package/dist/src/types/opencv/core_utils.js.map +1 -0
- package/dist/src/types/opencv/dnn.d.ts +336 -0
- package/dist/src/types/opencv/dnn.js +3 -0
- package/dist/src/types/opencv/dnn.js.map +1 -0
- package/dist/src/types/opencv/features2d_draw.d.ts +75 -0
- package/dist/src/types/opencv/features2d_draw.js +3 -0
- package/dist/src/types/opencv/features2d_draw.js.map +1 -0
- package/dist/src/types/opencv/imgproc_color_conversions.d.ts +299 -0
- package/dist/src/types/opencv/imgproc_color_conversions.js +3 -0
- package/dist/src/types/opencv/imgproc_color_conversions.js.map +1 -0
- package/dist/src/types/opencv/imgproc_draw.d.ts +502 -0
- package/dist/src/types/opencv/imgproc_draw.js +3 -0
- package/dist/src/types/opencv/imgproc_draw.js.map +1 -0
- package/dist/src/types/opencv/imgproc_feature.d.ts +533 -0
- package/dist/src/types/opencv/imgproc_feature.js +3 -0
- package/dist/src/types/opencv/imgproc_feature.js.map +1 -0
- package/dist/src/types/opencv/imgproc_filter.d.ts +689 -0
- package/dist/src/types/opencv/imgproc_filter.js +3 -0
- package/dist/src/types/opencv/imgproc_filter.js.map +1 -0
- package/dist/src/types/opencv/imgproc_hist.d.ts +291 -0
- package/dist/src/types/opencv/imgproc_hist.js +3 -0
- package/dist/src/types/opencv/imgproc_hist.js.map +1 -0
- package/dist/src/types/opencv/imgproc_misc.d.ts +473 -0
- package/dist/src/types/opencv/imgproc_misc.js +3 -0
- package/dist/src/types/opencv/imgproc_misc.js.map +1 -0
- package/dist/src/types/opencv/imgproc_object.d.ts +41 -0
- package/dist/src/types/opencv/imgproc_object.js +3 -0
- package/dist/src/types/opencv/imgproc_object.js.map +1 -0
- package/dist/src/types/opencv/imgproc_shape.d.ts +570 -0
- package/dist/src/types/opencv/imgproc_shape.js +3 -0
- package/dist/src/types/opencv/imgproc_shape.js.map +1 -0
- package/dist/src/types/opencv/imgproc_transform.d.ts +430 -0
- package/dist/src/types/opencv/imgproc_transform.js +3 -0
- package/dist/src/types/opencv/imgproc_transform.js.map +1 -0
- package/dist/src/types/opencv/index.d.ts +4 -0
- package/dist/src/types/opencv/index.js +19 -0
- package/dist/src/types/opencv/index.js.map +1 -0
- package/dist/src/types/opencv/objdetect.d.ts +43 -0
- package/dist/src/types/opencv/objdetect.js +3 -0
- package/dist/src/types/opencv/objdetect.js.map +1 -0
- package/dist/src/types/opencv/photo_inpaint.d.ts +25 -0
- package/dist/src/types/opencv/photo_inpaint.js +3 -0
- package/dist/src/types/opencv/photo_inpaint.js.map +1 -0
- package/dist/src/types/opencv/softdouble.d.ts +38 -0
- package/dist/src/types/opencv/softdouble.js +3 -0
- package/dist/src/types/opencv/softdouble.js.map +1 -0
- package/dist/src/types/opencv/softfloat.d.ts +38 -0
- package/dist/src/types/opencv/softfloat.js +3 -0
- package/dist/src/types/opencv/softfloat.js.map +1 -0
- package/dist/src/types/opencv/video_track.d.ts +276 -0
- package/dist/src/types/opencv/video_track.js +3 -0
- package/dist/src/types/opencv/video_track.js.map +1 -0
- package/package.json +5 -3
- package/src/index.ts +1 -0
- package/src/types/_cv.ts +6 -0
- package/src/types/emscripten.ts +286 -0
- package/src/types/opencv/Affine3.ts +206 -0
- package/src/types/opencv/Algorithm.ts +126 -0
- package/src/types/opencv/AutoBuffer.ts +50 -0
- package/src/types/opencv/BFMatcher.ts +37 -0
- package/src/types/opencv/BOWTrainer.ts +43 -0
- package/src/types/opencv/CascadeClassifier.ts +153 -0
- package/src/types/opencv/DescriptorMatcher.ts +244 -0
- package/src/types/opencv/DynamicBitset.ts +68 -0
- package/src/types/opencv/Exception.ts +54 -0
- package/src/types/opencv/Feature2D.ts +20 -0
- package/src/types/opencv/FlannBasedMatcher.ts +50 -0
- package/src/types/opencv/HOGDescriptor.ts +401 -0
- package/src/types/opencv/Logger.ts +34 -0
- package/src/types/opencv/LshTable.ts +81 -0
- package/src/types/opencv/Mat.ts +1764 -0
- package/src/types/opencv/MatExpr.ts +107 -0
- package/src/types/opencv/MatOp.ts +70 -0
- package/src/types/opencv/Matx.ts +228 -0
- package/src/types/opencv/Node.ts +33 -0
- package/src/types/opencv/ORB.ts +22 -0
- package/src/types/opencv/PCA.ts +204 -0
- package/src/types/opencv/RotatedRect.ts +72 -0
- package/src/types/opencv/_hacks.ts +322 -0
- package/src/types/opencv/_types.ts +44 -0
- package/src/types/opencv/calib3d.ts +2937 -0
- package/src/types/opencv/core_array.ts +3102 -0
- package/src/types/opencv/core_cluster.ts +81 -0
- package/src/types/opencv/core_hal_interface.ts +159 -0
- package/src/types/opencv/core_utils.ts +748 -0
- package/src/types/opencv/dnn.ts +505 -0
- package/src/types/opencv/features2d_draw.ts +114 -0
- package/src/types/opencv/imgproc_color_conversions.ts +527 -0
- package/src/types/opencv/imgproc_draw.ts +733 -0
- package/src/types/opencv/imgproc_feature.ts +681 -0
- package/src/types/opencv/imgproc_filter.ts +918 -0
- package/src/types/opencv/imgproc_hist.ts +399 -0
- package/src/types/opencv/imgproc_misc.ts +616 -0
- package/src/types/opencv/imgproc_object.ts +58 -0
- package/src/types/opencv/imgproc_shape.ts +734 -0
- package/src/types/opencv/imgproc_transform.ts +574 -0
- package/src/types/opencv/index.ts +4 -0
- package/src/types/opencv/objdetect.ts +103 -0
- package/src/types/opencv/photo_inpaint.ts +37 -0
- package/src/types/opencv/softdouble.ts +64 -0
- package/src/types/opencv/softfloat.ts +64 -0
- package/src/types/opencv/video_track.ts +372 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mat.js","sourceRoot":"","sources":["../../../../src/types/opencv/Mat.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { double, int, Mat, MatOp, Scalar } from "./_types";
|
|
2
|
+
/**
|
|
3
|
+
* <a name="d1/d10/classcv_1_1MatExpr_1MatrixExpressions"></a>This is a list of implemented matrix
|
|
4
|
+
* operations that can be combined in arbitrary complex expressions (here A, B stand for matrices (
|
|
5
|
+
* [Mat](#d3/d63/classcv_1_1Mat}) ), s for a scalar ( Scalar ), alpha for a real-valued scalar ( double
|
|
6
|
+
* )):
|
|
7
|
+
*
|
|
8
|
+
* Addition, subtraction, negation: `A+B`, `A-B`, `A+s`, `A-s`, `s+A`, `s-A`, `-A`
|
|
9
|
+
* Scaling: `A*alpha`
|
|
10
|
+
* Per-element multiplication and division: `A.mul(B)`, `A/B`, `alpha/A`
|
|
11
|
+
* Matrix multiplication: `A*B`
|
|
12
|
+
* Transposition: `A.t()` (means A)
|
|
13
|
+
* Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems:
|
|
14
|
+
* `A.inv([method]) (~ A<sup>-1</sup>)`, `A.inv([method])*B (~ X: AX=B)`
|
|
15
|
+
* Comparison: `A cmpop B`, `A cmpop alpha`, `alpha cmpop A`, where *cmpop* is one of `>`, `>=`, `==`,
|
|
16
|
+
* `!=`, `<=`, `<`. The result of comparison is an 8-bit single channel mask whose elements are set to
|
|
17
|
+
* 255 (if the particular element or pair of elements satisfy the condition) or 0.
|
|
18
|
+
* Bitwise logical operations: `A logicop B`, `A logicop s`, `s logicop A`, `~A`, where *logicop* is
|
|
19
|
+
* one of `&`, `|`, `^`.
|
|
20
|
+
* Element-wise minimum and maximum: `min(A, B)`, `min(A, alpha)`, `max(A, B)`, `max(A, alpha)`
|
|
21
|
+
* Element-wise absolute value: `abs(A)`
|
|
22
|
+
* Cross-product, dot-product: `A.cross(B)`, `A.dot(B)`
|
|
23
|
+
* Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm,
|
|
24
|
+
* mean, sum, countNonZero, trace, determinant, repeat, and others.
|
|
25
|
+
* Matrix initializers ( [Mat::eye()](#d3/d63/classcv_1_1Mat_1a2cf9b9acde7a9852542bbc20ef851ed2}),
|
|
26
|
+
* [Mat::zeros()](#d3/d63/classcv_1_1Mat_1a0b57b6a326c8876d944d188a46e0f556}),
|
|
27
|
+
* [Mat::ones()](#d3/d63/classcv_1_1Mat_1a69ae0402d116fc9c71908d8508dc2f09}) ), matrix comma-separated
|
|
28
|
+
* initializers, matrix constructors and operators that extract sub-matrices (see
|
|
29
|
+
* [Mat](#d3/d63/classcv_1_1Mat}) description).
|
|
30
|
+
* Mat_<destination_type>() constructors to cast the result to the proper type.
|
|
31
|
+
*
|
|
32
|
+
* Comma-separated initializers and probably some other operations may require additional explicit
|
|
33
|
+
* Mat() or Mat_<T>() constructor calls to resolve a possible ambiguity.
|
|
34
|
+
* Here are examples of matrix expressions:
|
|
35
|
+
*
|
|
36
|
+
* ```cpp
|
|
37
|
+
* // compute pseudo-inverse of A, equivalent to A.inv(DECOMP_SVD)
|
|
38
|
+
* SVD svd(A);
|
|
39
|
+
* Mat pinvA = svd.vt.t()*Mat::diag(1./svd.w)*svd.u.t();
|
|
40
|
+
*
|
|
41
|
+
* // compute the new vector of parameters in the Levenberg-Marquardt algorithm
|
|
42
|
+
* x -= (A.t()*A + lambda*Mat::eye(A.cols,A.cols,A.type())).inv(DECOMP_CHOLESKY)*(A.t()*err);
|
|
43
|
+
*
|
|
44
|
+
* // sharpen image using "unsharp mask" algorithm
|
|
45
|
+
* Mat blurred; double sigma = 1, threshold = 5, amount = 1;
|
|
46
|
+
* GaussianBlur(img, blurred, Size(), sigma, sigma);
|
|
47
|
+
* Mat lowContrastMask = abs(img - blurred) < threshold;
|
|
48
|
+
* Mat sharpened = img*(1+amount) + blurred*(-amount);
|
|
49
|
+
* img.copyTo(sharpened, lowContrastMask);
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Source:
|
|
53
|
+
* [opencv2/core/mat.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/mat.hpp#L3557).
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export declare class MatExpr extends Mat {
|
|
57
|
+
a: Mat;
|
|
58
|
+
alpha: double;
|
|
59
|
+
b: Mat;
|
|
60
|
+
beta: double;
|
|
61
|
+
c: Mat;
|
|
62
|
+
flags: int;
|
|
63
|
+
op: MatOp;
|
|
64
|
+
s: Scalar;
|
|
65
|
+
constructor();
|
|
66
|
+
constructor(m: Mat);
|
|
67
|
+
constructor(_op: MatOp, _flags: int, _a?: Mat, _b?: Mat, _c?: Mat, _alpha?: double, _beta?: double, _s?: Scalar);
|
|
68
|
+
col(x: int): MatExpr;
|
|
69
|
+
cross(m: Mat): Mat;
|
|
70
|
+
diag(d?: int): MatExpr;
|
|
71
|
+
dot(m: Mat): Mat;
|
|
72
|
+
inv(method?: int): MatExpr;
|
|
73
|
+
mul(e: MatExpr, scale?: double): MatExpr;
|
|
74
|
+
mul(m: Mat, scale?: double): MatExpr;
|
|
75
|
+
row(y: int): MatExpr;
|
|
76
|
+
t(): MatExpr;
|
|
77
|
+
type(): int;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatExpr.js","sourceRoot":"","sources":["../../../../src/types/opencv/MatExpr.ts"],"names":[],"mappings":";;AAAA,qCAA2D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { double, int, Mat, MatExpr, Scalar, Size } from "./_types";
|
|
2
|
+
export declare class MatOp {
|
|
3
|
+
constructor();
|
|
4
|
+
abs(expr: MatExpr, res: MatExpr): MatExpr;
|
|
5
|
+
add(expr1: MatExpr, expr2: MatExpr, res: MatExpr): MatExpr;
|
|
6
|
+
add(expr1: MatExpr, s: Scalar, res: MatExpr): MatExpr;
|
|
7
|
+
assign(expr: MatExpr, m: Mat, type?: int): MatExpr;
|
|
8
|
+
augAssignAdd(expr: MatExpr, m: Mat): MatExpr;
|
|
9
|
+
augAssignAnd(expr: MatExpr, m: Mat): MatExpr;
|
|
10
|
+
augAssignDivide(expr: MatExpr, m: Mat): MatExpr;
|
|
11
|
+
augAssignMultiply(expr: MatExpr, m: Mat): MatExpr;
|
|
12
|
+
augAssignOr(expr: MatExpr, m: Mat): MatExpr;
|
|
13
|
+
augAssignSubtract(expr: MatExpr, m: Mat): MatExpr;
|
|
14
|
+
augAssignXor(expr: MatExpr, m: Mat): MatExpr;
|
|
15
|
+
diag(expr: MatExpr, d: int, res: MatExpr): MatExpr;
|
|
16
|
+
divide(expr1: MatExpr, expr2: MatExpr, res: MatExpr, scale?: double): MatExpr;
|
|
17
|
+
divide(s: double, expr: MatExpr, res: MatExpr): MatExpr;
|
|
18
|
+
elementWise(expr: MatExpr): MatExpr;
|
|
19
|
+
invert(expr: MatExpr, method: int, res: MatExpr): MatExpr;
|
|
20
|
+
matmul(expr1: MatExpr, expr2: MatExpr, res: MatExpr): MatExpr;
|
|
21
|
+
multiply(expr1: MatExpr, expr2: MatExpr, res: MatExpr, scale?: double): MatExpr;
|
|
22
|
+
multiply(expr1: MatExpr, s: double, res: MatExpr): MatExpr;
|
|
23
|
+
roi(expr: MatExpr, rowRange: Range, colRange: Range, res: MatExpr): MatExpr;
|
|
24
|
+
size(expr: MatExpr): Size;
|
|
25
|
+
subtract(expr1: MatExpr, expr2: MatExpr, res: MatExpr): MatExpr;
|
|
26
|
+
subtract(s: Scalar, expr: MatExpr, res: MatExpr): Scalar;
|
|
27
|
+
transpose(expr: MatExpr, res: MatExpr): MatExpr;
|
|
28
|
+
type(expr: MatExpr): MatExpr;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatOp.js","sourceRoot":"","sources":["../../../../src/types/opencv/MatOp.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { diag_type, int, Matx_AddOp, Matx_DivOp, Matx_MatMulOp, Matx_MulOp, Matx_ScaleOp, Matx_SubOp, Matx_TOp, Vec, _T2, _Tp } from "./_types";
|
|
2
|
+
/**
|
|
3
|
+
* If you need a more flexible type, use [Mat](#d3/d63/classcv_1_1Mat}) . The elements of the matrix M
|
|
4
|
+
* are accessible using the M(i,j) notation. Most of the common matrix operations (see also
|
|
5
|
+
* [MatrixExpressions](#d1/d10/classcv_1_1MatExpr_1MatrixExpressions}) ) are available. To do an
|
|
6
|
+
* operation on [Matx](#de/de1/classcv_1_1Matx}) that is not implemented, you can easily convert the
|
|
7
|
+
* matrix to [Mat](#d3/d63/classcv_1_1Mat}) and backwards:
|
|
8
|
+
*
|
|
9
|
+
* ```cpp
|
|
10
|
+
* Matx33f m(1, 2, 3,
|
|
11
|
+
* 4, 5, 6,
|
|
12
|
+
* 7, 8, 9);
|
|
13
|
+
* cout << sum(Mat(m*m.t())) << endl;
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Except of the plain constructor which takes a list of elements, [Matx](#de/de1/classcv_1_1Matx})
|
|
17
|
+
* can be initialized from a C-array:
|
|
18
|
+
*
|
|
19
|
+
* ```cpp
|
|
20
|
+
* float values[] = { 1, 2, 3};
|
|
21
|
+
* Matx31f m(values);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* In case if C++11 features are available, std::initializer_list can be also used to initialize
|
|
25
|
+
* [Matx](#de/de1/classcv_1_1Matx}):
|
|
26
|
+
*
|
|
27
|
+
* ```cpp
|
|
28
|
+
* Matx31f m = { 1, 2, 3};
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Source:
|
|
32
|
+
* [opencv2/core/matx.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/matx.hpp#L1185).
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export declare class Matx {
|
|
36
|
+
val: _Tp;
|
|
37
|
+
constructor();
|
|
38
|
+
constructor(v0: _Tp);
|
|
39
|
+
constructor(v0: _Tp, v1: _Tp);
|
|
40
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp);
|
|
41
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp);
|
|
42
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp);
|
|
43
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp);
|
|
44
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp);
|
|
45
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp);
|
|
46
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp, v8: _Tp);
|
|
47
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp, v8: _Tp, v9: _Tp);
|
|
48
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp, v8: _Tp, v9: _Tp, v10: _Tp, v11: _Tp);
|
|
49
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp, v8: _Tp, v9: _Tp, v10: _Tp, v11: _Tp, v12: _Tp, v13: _Tp);
|
|
50
|
+
constructor(v0: _Tp, v1: _Tp, v2: _Tp, v3: _Tp, v4: _Tp, v5: _Tp, v6: _Tp, v7: _Tp, v8: _Tp, v9: _Tp, v10: _Tp, v11: _Tp, v12: _Tp, v13: _Tp, v14: _Tp, v15: _Tp);
|
|
51
|
+
constructor(vals: any);
|
|
52
|
+
constructor(arg334: any);
|
|
53
|
+
constructor(a: Matx, b: Matx, arg335: Matx_AddOp);
|
|
54
|
+
constructor(a: Matx, b: Matx, arg336: Matx_SubOp);
|
|
55
|
+
constructor(arg337: any, a: Matx, alpha: _T2, arg338: Matx_ScaleOp);
|
|
56
|
+
constructor(a: Matx, b: Matx, arg339: Matx_MulOp);
|
|
57
|
+
constructor(a: Matx, b: Matx, arg340: Matx_DivOp);
|
|
58
|
+
constructor(l: int, a: Matx, b: Matx, arg341: Matx_MatMulOp);
|
|
59
|
+
constructor(a: Matx, arg342: Matx_TOp);
|
|
60
|
+
col(i: int): Matx;
|
|
61
|
+
ddot(v: Matx): Matx;
|
|
62
|
+
diag(): diag_type;
|
|
63
|
+
div(a: Matx): Matx;
|
|
64
|
+
dot(v: Matx): Matx;
|
|
65
|
+
get_minor(m1: int, n1: int, base_row: int, base_col: int): Matx;
|
|
66
|
+
inv(method?: int, p_is_ok?: any): Matx;
|
|
67
|
+
mul(a: Matx): Matx;
|
|
68
|
+
reshape(m1: int, n1: int): Matx;
|
|
69
|
+
row(i: int): Matx;
|
|
70
|
+
solve(l: int, rhs: Matx, flags?: int): Matx;
|
|
71
|
+
solve(rhs: Vec, method: int): Vec;
|
|
72
|
+
t(): Matx;
|
|
73
|
+
static all(alpha: _Tp): Matx;
|
|
74
|
+
static diag(d: diag_type): Matx;
|
|
75
|
+
static eye(): Matx;
|
|
76
|
+
static ones(): Matx;
|
|
77
|
+
static randn(a: _Tp, b: _Tp): Matx;
|
|
78
|
+
static randu(a: _Tp, b: _Tp): Matx;
|
|
79
|
+
static zeros(): Matx;
|
|
80
|
+
}
|
|
81
|
+
export declare const rows: any;
|
|
82
|
+
export declare const cols: any;
|
|
83
|
+
export declare const channels: any;
|
|
84
|
+
export declare const shortdim: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Matx.js","sourceRoot":"","sources":["../../../../src/types/opencv/Matx.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { double, int } from "./_types";
|
|
2
|
+
export declare class Node {
|
|
3
|
+
/**
|
|
4
|
+
* Class index normalized to 0..class_count-1 range and assigned to the node. It is used internally
|
|
5
|
+
* in classification trees and tree ensembles.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
classIdx: int;
|
|
9
|
+
/**
|
|
10
|
+
* Default direction where to go (-1: left or +1: right). It helps in the case of missing values.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
defaultDir: int;
|
|
14
|
+
left: int;
|
|
15
|
+
parent: int;
|
|
16
|
+
right: int;
|
|
17
|
+
split: int;
|
|
18
|
+
/**
|
|
19
|
+
* Value at the node: a class label in case of classification or estimated function value in case of
|
|
20
|
+
* regression.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
value: double;
|
|
24
|
+
constructor();
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/types/opencv/Node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Feature2D, float, int } from "./_types";
|
|
2
|
+
/**
|
|
3
|
+
* https://docs.opencv.org/4.8.0/db/d95/classcv_1_1ORB.html
|
|
4
|
+
*/
|
|
5
|
+
export declare class ORB extends Feature2D {
|
|
6
|
+
constructor(nfeatures?: int, scaleFactor?: float, nlevels?: int, edgeThreshold?: int, firstLevel?: int, WTA_K?: int, scoreType?: ORBScoreType, patchSize?: int, fastThreshold?: int);
|
|
7
|
+
}
|
|
8
|
+
type ORBScoreType = int;
|
|
9
|
+
export declare const ORB_HARRIS_SCORE: ORBScoreType;
|
|
10
|
+
export declare const ORB_FAST_SCORE: ORBScoreType;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ORB.js","sourceRoot":"","sources":["../../../../src/types/opencv/ORB.ts"],"names":[],"mappings":";;AAAA,qCAAiD"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { double, FileNode, FileStorage, InputArray, int, Mat, OutputArray } from "./_types";
|
|
2
|
+
/**
|
|
3
|
+
* The class is used to calculate a special basis for a set of vectors. The basis will consist of
|
|
4
|
+
* eigenvectors of the covariance matrix calculated from the input set of vectors. The class PCA can
|
|
5
|
+
* also transform vectors to/from the new coordinate space defined by the basis. Usually, in this new
|
|
6
|
+
* coordinate system, each vector from the original set (and any linear combination of such vectors)
|
|
7
|
+
* can be quite accurately approximated by taking its first few components, corresponding to the
|
|
8
|
+
* eigenvectors of the largest eigenvalues of the covariance matrix. Geometrically it means that you
|
|
9
|
+
* calculate a projection of the vector to a subspace formed by a few eigenvectors corresponding to the
|
|
10
|
+
* dominant eigenvalues of the covariance matrix. And usually such a projection is very close to the
|
|
11
|
+
* original vector. So, you can represent the original vector from a high-dimensional space with a much
|
|
12
|
+
* shorter vector consisting of the projected vector's coordinates in the subspace. Such a
|
|
13
|
+
* transformation is also known as Karhunen-Loeve Transform, or KLT. See
|
|
14
|
+
*
|
|
15
|
+
* The sample below is the function that takes two matrices. The first function stores a set of vectors
|
|
16
|
+
* (a row per vector) that is used to calculate [PCA](#d3/d8d/classcv_1_1PCA}). The second function
|
|
17
|
+
* stores another "test" set of vectors (a row per vector). First, these vectors are compressed with
|
|
18
|
+
* [PCA](#d3/d8d/classcv_1_1PCA}), then reconstructed back, and then the reconstruction error norm is
|
|
19
|
+
* computed and printed for each vector. :
|
|
20
|
+
*
|
|
21
|
+
* ```cpp
|
|
22
|
+
* using namespace cv;
|
|
23
|
+
*
|
|
24
|
+
* PCA compressPCA(const Mat& pcaset, int maxComponents,
|
|
25
|
+
* const Mat& testset, Mat& compressed)
|
|
26
|
+
* {
|
|
27
|
+
* PCA pca(pcaset, // pass the data
|
|
28
|
+
* Mat(), // we do not have a pre-computed mean vector,
|
|
29
|
+
* // so let the PCA engine to compute it
|
|
30
|
+
* PCA::DATA_AS_ROW, // indicate that the vectors
|
|
31
|
+
* // are stored as matrix rows
|
|
32
|
+
* // (use PCA::DATA_AS_COL if the vectors are
|
|
33
|
+
* // the matrix columns)
|
|
34
|
+
* maxComponents // specify, how many principal components to retain
|
|
35
|
+
* );
|
|
36
|
+
* // if there is no test data, just return the computed basis, ready-to-use
|
|
37
|
+
* if( !testset.data )
|
|
38
|
+
* return pca;
|
|
39
|
+
* CV_Assert( testset.cols == pcaset.cols );
|
|
40
|
+
*
|
|
41
|
+
* compressed.create(testset.rows, maxComponents, testset.type());
|
|
42
|
+
*
|
|
43
|
+
* Mat reconstructed;
|
|
44
|
+
* for( int i = 0; i < testset.rows; i++ )
|
|
45
|
+
* {
|
|
46
|
+
* Mat vec = testset.row(i), coeffs = compressed.row(i), reconstructed;
|
|
47
|
+
* // compress the vector, the result will be stored
|
|
48
|
+
* // in the i-th row of the output matrix
|
|
49
|
+
* pca.project(vec, coeffs);
|
|
50
|
+
* // and then reconstruct it
|
|
51
|
+
* pca.backProject(coeffs, reconstructed);
|
|
52
|
+
* // and measure the error
|
|
53
|
+
* printf("%d. diff = %g\\n", i, norm(vec, reconstructed, NORM_L2));
|
|
54
|
+
* }
|
|
55
|
+
* return pca;
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* [calcCovarMatrix](#d2/de8/group__core__array_1gae6ffa9354633f984246945d52823165d}),
|
|
60
|
+
* [mulTransposed](#d2/de8/group__core__array_1gadc4e49f8f7a155044e3be1b9e3b270ab}),
|
|
61
|
+
* [SVD](#df/df7/classcv_1_1SVD}),
|
|
62
|
+
* [dft](#d2/de8/group__core__array_1gadd6cf9baf2b8b704a11b5f04aaf4f39d}),
|
|
63
|
+
* [dct](#d2/de8/group__core__array_1ga85aad4d668c01fbd64825f589e3696d4})
|
|
64
|
+
*
|
|
65
|
+
* Source:
|
|
66
|
+
* [opencv2/core.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core.hpp#L2393).
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
export declare class PCA {
|
|
70
|
+
eigenvalues: Mat;
|
|
71
|
+
eigenvectors: Mat;
|
|
72
|
+
mean: Mat;
|
|
73
|
+
/**
|
|
74
|
+
* The default constructor initializes an empty PCA structure. The other constructors initialize the
|
|
75
|
+
* structure and call [PCA::operator()()].
|
|
76
|
+
*/
|
|
77
|
+
constructor();
|
|
78
|
+
/**
|
|
79
|
+
* This is an overloaded member function, provided for convenience. It differs from the above
|
|
80
|
+
* function only in what argument(s) it accepts.
|
|
81
|
+
*
|
|
82
|
+
* @param data input samples stored as matrix rows or matrix columns.
|
|
83
|
+
*
|
|
84
|
+
* @param mean optional mean value; if the matrix is empty (noArray()), the mean is computed from the
|
|
85
|
+
* data.
|
|
86
|
+
*
|
|
87
|
+
* @param flags operation flags; currently the parameter is only used to specify the data layout
|
|
88
|
+
* (PCA::Flags)
|
|
89
|
+
*
|
|
90
|
+
* @param maxComponents maximum number of components that PCA should retain; by default, all the
|
|
91
|
+
* components are retained.
|
|
92
|
+
*/
|
|
93
|
+
constructor(data: InputArray, mean: InputArray, flags: int, maxComponents?: int);
|
|
94
|
+
/**
|
|
95
|
+
* This is an overloaded member function, provided for convenience. It differs from the above
|
|
96
|
+
* function only in what argument(s) it accepts.
|
|
97
|
+
*
|
|
98
|
+
* @param data input samples stored as matrix rows or matrix columns.
|
|
99
|
+
*
|
|
100
|
+
* @param mean optional mean value; if the matrix is empty (noArray()), the mean is computed from the
|
|
101
|
+
* data.
|
|
102
|
+
*
|
|
103
|
+
* @param flags operation flags; currently the parameter is only used to specify the data layout
|
|
104
|
+
* (PCA::Flags)
|
|
105
|
+
*
|
|
106
|
+
* @param retainedVariance Percentage of variance that PCA should retain. Using this parameter will
|
|
107
|
+
* let the PCA decided how many components to retain but it will always keep at least 2.
|
|
108
|
+
*/
|
|
109
|
+
constructor(data: InputArray, mean: InputArray, flags: int, retainedVariance: double);
|
|
110
|
+
/**
|
|
111
|
+
* The methods are inverse operations to [PCA::project]. They take PC coordinates of projected
|
|
112
|
+
* vectors and reconstruct the original vectors. Unless all the principal components have been
|
|
113
|
+
* retained, the reconstructed vectors are different from the originals. But typically, the difference
|
|
114
|
+
* is small if the number of components is large enough (but still much smaller than the original
|
|
115
|
+
* vector dimensionality). As a result, [PCA] is used.
|
|
116
|
+
*
|
|
117
|
+
* @param vec coordinates of the vectors in the principal component subspace, the layout and size are
|
|
118
|
+
* the same as of PCA::project output vectors.
|
|
119
|
+
*/
|
|
120
|
+
backProject(vec: InputArray): Mat;
|
|
121
|
+
/**
|
|
122
|
+
* This is an overloaded member function, provided for convenience. It differs from the above
|
|
123
|
+
* function only in what argument(s) it accepts.
|
|
124
|
+
*
|
|
125
|
+
* @param vec coordinates of the vectors in the principal component subspace, the layout and size are
|
|
126
|
+
* the same as of PCA::project output vectors.
|
|
127
|
+
*
|
|
128
|
+
* @param result reconstructed vectors; the layout and size are the same as of PCA::project input
|
|
129
|
+
* vectors.
|
|
130
|
+
*/
|
|
131
|
+
backProject(vec: InputArray, result: OutputArray): InputArray;
|
|
132
|
+
/**
|
|
133
|
+
* The methods project one or more vectors to the principal component subspace, where each vector
|
|
134
|
+
* projection is represented by coefficients in the principal component basis. The first form of the
|
|
135
|
+
* method returns the matrix that the second form writes to the result. So the first form can be used
|
|
136
|
+
* as a part of expression while the second form can be more efficient in a processing loop.
|
|
137
|
+
*
|
|
138
|
+
* @param vec input vector(s); must have the same dimensionality and the same layout as the input
|
|
139
|
+
* data used at PCA phase, that is, if DATA_AS_ROW are specified, then vec.cols==data.cols (vector
|
|
140
|
+
* dimensionality) and vec.rows is the number of vectors to project, and the same is true for the
|
|
141
|
+
* PCA::DATA_AS_COL case.
|
|
142
|
+
*/
|
|
143
|
+
project(vec: InputArray): Mat;
|
|
144
|
+
/**
|
|
145
|
+
* This is an overloaded member function, provided for convenience. It differs from the above
|
|
146
|
+
* function only in what argument(s) it accepts.
|
|
147
|
+
*
|
|
148
|
+
* @param vec input vector(s); must have the same dimensionality and the same layout as the input
|
|
149
|
+
* data used at PCA phase, that is, if DATA_AS_ROW are specified, then vec.cols==data.cols (vector
|
|
150
|
+
* dimensionality) and vec.rows is the number of vectors to project, and the same is true for the
|
|
151
|
+
* PCA::DATA_AS_COL case.
|
|
152
|
+
*
|
|
153
|
+
* @param result output vectors; in case of PCA::DATA_AS_COL, the output matrix has as many columns
|
|
154
|
+
* as the number of input vectors, this means that result.cols==vec.cols and the number of rows match
|
|
155
|
+
* the number of principal components (for example, maxComponents parameter passed to the constructor).
|
|
156
|
+
*/
|
|
157
|
+
project(vec: InputArray, result: OutputArray): InputArray;
|
|
158
|
+
/**
|
|
159
|
+
* Loads [eigenvalues] [eigenvectors] and [mean] from specified [FileNode]
|
|
160
|
+
*/
|
|
161
|
+
read(fn: FileNode): FileNode;
|
|
162
|
+
/**
|
|
163
|
+
* Writes [eigenvalues] [eigenvectors] and [mean] to specified [FileStorage]
|
|
164
|
+
*/
|
|
165
|
+
write(fs: FileStorage): FileStorage;
|
|
166
|
+
}
|
|
167
|
+
export declare const DATA_AS_ROW: Flags;
|
|
168
|
+
export declare const DATA_AS_COL: Flags;
|
|
169
|
+
export declare const USE_AVG: Flags;
|
|
170
|
+
export type Flags = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PCA.js","sourceRoot":"","sources":["../../../../src/types/opencv/PCA.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { float, Point2f, Rect, Rect_, Size2f } from "./_types";
|
|
2
|
+
/**
|
|
3
|
+
* Each rectangle is specified by the center point (mass center), length of each side (represented by
|
|
4
|
+
* [Size2f](#dc/d84/group__core__basic_1gab34496d2466b5f69930ab74c70f117d4}) structure) and the
|
|
5
|
+
* rotation angle in degrees.
|
|
6
|
+
*
|
|
7
|
+
* The sample below demonstrates how to use [RotatedRect](#db/dd6/classcv_1_1RotatedRect}):
|
|
8
|
+
*
|
|
9
|
+
* ```cpp
|
|
10
|
+
* Mat test_image(200, 200, CV_8UC3, Scalar(0));
|
|
11
|
+
* RotatedRect rRect = RotatedRect(Point2f(100,100), Size2f(100,50), 30);
|
|
12
|
+
*
|
|
13
|
+
* Point2f vertices[4];
|
|
14
|
+
* rRect.points(vertices);
|
|
15
|
+
* for (int i = 0; i < 4; i++)
|
|
16
|
+
* line(test_image, vertices[i], vertices[(i+1)%4], Scalar(0,255,0), 2);
|
|
17
|
+
*
|
|
18
|
+
* Rect brect = rRect.boundingRect();
|
|
19
|
+
* rectangle(test_image, brect, Scalar(255,0,0), 2);
|
|
20
|
+
*
|
|
21
|
+
* imshow("rectangles", test_image);
|
|
22
|
+
* waitKey(0);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* [CamShift](#dc/d6b/group__video__track_1gaef2bd39c8356f423124f1fe7c44d54a1}),
|
|
26
|
+
* [fitEllipse](#d3/dc0/group__imgproc__shape_1gaf259efaad93098103d6c27b9e4900ffa}),
|
|
27
|
+
* [minAreaRect](#d3/dc0/group__imgproc__shape_1ga3d476a3417130ae5154aea421ca7ead9}), CvBox2D
|
|
28
|
+
*
|
|
29
|
+
* Source:
|
|
30
|
+
* [opencv2/core/types.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/types.hpp#L534).
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export declare class RotatedRect {
|
|
34
|
+
angle: float;
|
|
35
|
+
center: Point2f;
|
|
36
|
+
size: Size2f;
|
|
37
|
+
constructor();
|
|
38
|
+
/**
|
|
39
|
+
* full constructor
|
|
40
|
+
*
|
|
41
|
+
* @param center The rectangle mass center.
|
|
42
|
+
*
|
|
43
|
+
* @param size Width and height of the rectangle.
|
|
44
|
+
*
|
|
45
|
+
* @param angle The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc.,
|
|
46
|
+
* the rectangle becomes an up-right rectangle.
|
|
47
|
+
*/
|
|
48
|
+
constructor(center: Point2f, size: Size2f, angle: float);
|
|
49
|
+
/**
|
|
50
|
+
* Any 3 end points of the [RotatedRect]. They must be given in order (either clockwise or
|
|
51
|
+
* anticlockwise).
|
|
52
|
+
*/
|
|
53
|
+
constructor(point1: Point2f, point2: Point2f, point3: Point2f);
|
|
54
|
+
boundingRect(): Rect;
|
|
55
|
+
boundingRect2f(): Rect_;
|
|
56
|
+
/**
|
|
57
|
+
* returns 4 vertices of the rectangle
|
|
58
|
+
*
|
|
59
|
+
* @param pts The points array for storing rectangle vertices. The order is bottomLeft, topLeft,
|
|
60
|
+
* topRight, bottomRight.
|
|
61
|
+
*/
|
|
62
|
+
points(pts: Point2f): Point2f;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RotatedRect.js","sourceRoot":"","sources":["../../../../src/types/opencv/RotatedRect.ts"],"names":[],"mappings":""}
|