@techstark/opencv-js 4.10.0-release.1 → 4.12.0-release.1
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 +31 -3
- package/dist/opencv.js +1 -1
- package/dist/opencv.js.patch +4 -4
- package/dist/src/types/opencv/Feature2D.d.ts +1 -1
- package/dist/src/types/opencv/Mat.d.ts +1 -1
- package/dist/src/types/opencv/ORB.d.ts +1 -1
- package/dist/src/types/opencv/QRCodeDetector.d.ts +76 -0
- package/dist/src/types/opencv/QRCodeDetector.js +3 -0
- package/dist/src/types/opencv/QRCodeDetector.js.map +1 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.d.ts +101 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.js +3 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.js.map +1 -0
- package/dist/src/types/opencv/RotatedRect.d.ts +7 -8
- package/dist/src/types/opencv/_hacks.d.ts +1 -1
- package/dist/src/types/opencv/_types.d.ts +1 -0
- package/dist/src/types/opencv/_types.js +1 -0
- package/dist/src/types/opencv/_types.js.map +1 -1
- package/dist/src/types/opencv/imgproc_colormap.d.ts +43 -0
- package/dist/src/types/opencv/imgproc_colormap.js +3 -0
- package/dist/src/types/opencv/imgproc_colormap.js.map +1 -0
- package/dist/src/types/opencv/imgproc_shape.d.ts +2 -2
- package/dist/src/types/opencv/objdetect.d.ts +2 -0
- package/dist/src/types/opencv/objdetect.js +6 -0
- package/dist/src/types/opencv/objdetect.js.map +1 -1
- package/package.json +6 -6
- package/src/types/opencv/Feature2D.ts +1 -1
- package/src/types/opencv/FlannBasedMatcher.ts +8 -1
- package/src/types/opencv/Mat.ts +1 -1
- package/src/types/opencv/ORB.ts +1 -1
- package/src/types/opencv/QRCodeDetector.ts +111 -0
- package/src/types/opencv/QRCodeDetectorAruco.ts +139 -0
- package/src/types/opencv/RotatedRect.ts +6 -7
- package/src/types/opencv/_hacks.ts +5 -5
- package/src/types/opencv/_types.ts +1 -0
- package/src/types/opencv/imgproc_colormap.ts +60 -0
- package/src/types/opencv/imgproc_shape.ts +3 -5
- package/src/types/opencv/objdetect.ts +6 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
bool,
|
|
3
|
+
float,
|
|
4
|
+
InputArray,
|
|
5
|
+
OutputArray,
|
|
6
|
+
OutputArrayOfArrays,
|
|
7
|
+
} from "./_types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Parameters for QRCodeDetectorAruco
|
|
11
|
+
*/
|
|
12
|
+
export declare class QRCodeDetectorAruco_Params {
|
|
13
|
+
public minModuleSizeInPyramid: float;
|
|
14
|
+
public maxRotation: float;
|
|
15
|
+
public maxModuleSizeMismatch: float;
|
|
16
|
+
public maxTimingPatternMismatch: float;
|
|
17
|
+
public maxPenalties: float;
|
|
18
|
+
public maxColorsMismatch: float;
|
|
19
|
+
public scaleTimingPatternScore: float;
|
|
20
|
+
|
|
21
|
+
public constructor();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Releases the object
|
|
25
|
+
*/
|
|
26
|
+
public delete(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* QR Code detection and decoding class using Aruco-based detection.
|
|
31
|
+
*
|
|
32
|
+
* This class implements QR code detection and decoding functionality using
|
|
33
|
+
* Aruco marker detection techniques for improved robustness.
|
|
34
|
+
*
|
|
35
|
+
* Source:
|
|
36
|
+
* [opencv2/objdetect.hpp](https://github.com/opencv/opencv/tree/master/modules/objdetect/include/opencv2/objdetect.hpp).
|
|
37
|
+
*/
|
|
38
|
+
export declare class QRCodeDetectorAruco {
|
|
39
|
+
/**
|
|
40
|
+
* QRCodeDetectorAruco constructor
|
|
41
|
+
*/
|
|
42
|
+
public constructor();
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* QRCodeDetectorAruco constructor with parameters
|
|
46
|
+
*
|
|
47
|
+
* @param params QRCodeDetectorAruco parameters
|
|
48
|
+
*/
|
|
49
|
+
public constructor(params: QRCodeDetectorAruco_Params);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Detects QR code in image and returns the quadrangle containing the code.
|
|
53
|
+
*
|
|
54
|
+
* @param img grayscale or color (BGR) image containing (or not) QR code.
|
|
55
|
+
* @param points Output vector of vertices of the minimum-area quadrangle containing the code.
|
|
56
|
+
*/
|
|
57
|
+
public detect(img: InputArray, points: OutputArray): bool;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Decodes QR code in image once it's found by the detect() method.
|
|
61
|
+
*
|
|
62
|
+
* @param img grayscale or color (BGR) image containing QR code.
|
|
63
|
+
* @param points Quadrangle vertices found by detect() method (or some other algorithm).
|
|
64
|
+
* @param straight_qrcode The optional output image containing rectified and binarized QR code
|
|
65
|
+
*/
|
|
66
|
+
public decode(
|
|
67
|
+
img: InputArray,
|
|
68
|
+
points: InputArray,
|
|
69
|
+
straight_qrcode?: OutputArray,
|
|
70
|
+
): String;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Both detects and decodes QR code
|
|
74
|
+
*
|
|
75
|
+
* @param img grayscale or color (BGR) image containing QR code.
|
|
76
|
+
* @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
|
|
77
|
+
* @param straight_qrcode The optional output image containing rectified and binarized QR code
|
|
78
|
+
*/
|
|
79
|
+
public detectAndDecode(
|
|
80
|
+
img: InputArray,
|
|
81
|
+
points?: OutputArray,
|
|
82
|
+
straight_qrcode?: OutputArray,
|
|
83
|
+
): String;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Detects QR codes in image and returns the vector of the quadrangles containing the codes.
|
|
87
|
+
*
|
|
88
|
+
* @param img grayscale or color (BGR) image containing (or not) QR codes.
|
|
89
|
+
* @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
|
|
90
|
+
*/
|
|
91
|
+
public detectMulti(img: InputArray, points: OutputArrayOfArrays): bool;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Decodes QR codes in image once it's found by the detectMulti() method.
|
|
95
|
+
*
|
|
96
|
+
* @param img grayscale or color (BGR) image containing QR codes.
|
|
97
|
+
* @param points vector of Quadrangle vertices found by detectMulti() method (or some other algorithm).
|
|
98
|
+
* @param decoded_info UTF8-encoded output vector of String or empty vector of String if the codes cannot be decoded.
|
|
99
|
+
* @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes
|
|
100
|
+
*/
|
|
101
|
+
public decodeMulti(
|
|
102
|
+
img: InputArray,
|
|
103
|
+
points: InputArray,
|
|
104
|
+
decoded_info: any,
|
|
105
|
+
straight_qrcode?: OutputArrayOfArrays,
|
|
106
|
+
): bool;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Both detects and decodes QR codes
|
|
110
|
+
*
|
|
111
|
+
* @param img grayscale or color (BGR) image containing QR codes.
|
|
112
|
+
* @param decoded_info UTF8-encoded output vector of String or empty vector of String if the codes cannot be decoded.
|
|
113
|
+
* @param points optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.
|
|
114
|
+
* @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes
|
|
115
|
+
*/
|
|
116
|
+
public detectAndDecodeMulti(
|
|
117
|
+
img: InputArray,
|
|
118
|
+
decoded_info: any,
|
|
119
|
+
points?: OutputArrayOfArrays,
|
|
120
|
+
straight_qrcode?: OutputArrayOfArrays,
|
|
121
|
+
): bool;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get detector parameters
|
|
125
|
+
*/
|
|
126
|
+
public getDetectorParameters(): QRCodeDetectorAruco_Params;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Set detector parameters
|
|
130
|
+
*
|
|
131
|
+
* @param params QRCodeDetectorAruco parameters
|
|
132
|
+
*/
|
|
133
|
+
public setDetectorParameters(params: QRCodeDetectorAruco_Params): void;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Releases the object
|
|
137
|
+
*/
|
|
138
|
+
public delete(): void;
|
|
139
|
+
}
|
|
@@ -58,15 +58,14 @@ export declare class RotatedRect {
|
|
|
58
58
|
*/
|
|
59
59
|
public constructor(point1: Point2f, point2: Point2f, point3: Point2f);
|
|
60
60
|
|
|
61
|
-
public boundingRect(): Rect;
|
|
61
|
+
public static boundingRect(rect: RotatedRect): Rect;
|
|
62
62
|
|
|
63
|
-
public boundingRect2f():
|
|
63
|
+
public static boundingRect2f(rect: RotatedRect): Rect;
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
* @
|
|
69
|
-
* topRight, bottomRight.
|
|
66
|
+
returns 4 vertices of the rectangle
|
|
67
|
+
* @param rect The rotated rectangle
|
|
68
|
+
* @returns Array of 4 points in order: bottomLeft, topLeft, topRight, bottomRight
|
|
70
69
|
*/
|
|
71
|
-
public points(
|
|
70
|
+
public static points(rect: RotatedRect): Point2f[];
|
|
72
71
|
}
|
|
@@ -84,12 +84,12 @@ export declare class MinMaxLoc {
|
|
|
84
84
|
export declare function exceptionFromPtr(err: number): any;
|
|
85
85
|
export declare function onRuntimeInitialized(): any;
|
|
86
86
|
export declare function FS_createDataFile(
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
parent: string,
|
|
88
|
+
name: string,
|
|
89
89
|
data: Uint8Array,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
canRead: boolean,
|
|
91
|
+
canWrite: boolean,
|
|
92
|
+
canOwn: boolean,
|
|
93
93
|
): any;
|
|
94
94
|
|
|
95
95
|
import { Algorithm, type LineTypes, Mat, type NormTypes, RotatedRect } from ".";
|
|
@@ -19,6 +19,7 @@ export * from "./fisheye";
|
|
|
19
19
|
export * from "./FlannBasedMatcher";
|
|
20
20
|
export * from "./HOGDescriptor";
|
|
21
21
|
export * from "./imgproc_color_conversions";
|
|
22
|
+
export * from "./imgproc_colormap";
|
|
22
23
|
export * from "./imgproc_draw";
|
|
23
24
|
export * from "./imgproc_feature";
|
|
24
25
|
export * from "./imgproc_filter";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { InputArray, int, OutputArray } from "./_types";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* # Colormap Transformations
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Applies a colormap on a given image.
|
|
10
|
+
*
|
|
11
|
+
* @param src The source image, which should be grayscale. Should be 8-bit, 16-bit, or floating-point.
|
|
12
|
+
* @param dst The result is the colored image.
|
|
13
|
+
* @param colormap The colormap to apply.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyColorMap(
|
|
16
|
+
src: InputArray,
|
|
17
|
+
dst: OutputArray,
|
|
18
|
+
colormap: int,
|
|
19
|
+
): void;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Applies a user colormap on a given image.
|
|
23
|
+
*
|
|
24
|
+
* @param src The source image, which should be grayscale. Should be 8-bit, 16-bit, or floating-point.
|
|
25
|
+
* @param dst The result is the colored image.
|
|
26
|
+
* @param userColor The colormap to apply of type CV_8UC1 or CV_8UC3 and size 256.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyColorMap(
|
|
29
|
+
src: InputArray,
|
|
30
|
+
dst: OutputArray,
|
|
31
|
+
userColor: InputArray,
|
|
32
|
+
): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Colormap types used by the applyColorMap function.
|
|
36
|
+
*/
|
|
37
|
+
export type ColormapTypes = any;
|
|
38
|
+
|
|
39
|
+
export declare const COLORMAP_AUTUMN: ColormapTypes; // initializer: = 0
|
|
40
|
+
export declare const COLORMAP_BONE: ColormapTypes; // initializer: = 1
|
|
41
|
+
export declare const COLORMAP_JET: ColormapTypes; // initializer: = 2
|
|
42
|
+
export declare const COLORMAP_WINTER: ColormapTypes; // initializer: = 3
|
|
43
|
+
export declare const COLORMAP_RAINBOW: ColormapTypes; // initializer: = 4
|
|
44
|
+
export declare const COLORMAP_OCEAN: ColormapTypes; // initializer: = 5
|
|
45
|
+
export declare const COLORMAP_SUMMER: ColormapTypes; // initializer: = 6
|
|
46
|
+
export declare const COLORMAP_SPRING: ColormapTypes; // initializer: = 7
|
|
47
|
+
export declare const COLORMAP_COOL: ColormapTypes; // initializer: = 8
|
|
48
|
+
export declare const COLORMAP_HSV: ColormapTypes; // initializer: = 9
|
|
49
|
+
export declare const COLORMAP_PINK: ColormapTypes; // initializer: = 10
|
|
50
|
+
export declare const COLORMAP_HOT: ColormapTypes; // initializer: = 11
|
|
51
|
+
export declare const COLORMAP_PARULA: ColormapTypes; // initializer: = 12
|
|
52
|
+
export declare const COLORMAP_MAGMA: ColormapTypes; // initializer: = 13
|
|
53
|
+
export declare const COLORMAP_INFERNO: ColormapTypes; // initializer: = 14
|
|
54
|
+
export declare const COLORMAP_PLASMA: ColormapTypes; // initializer: = 15
|
|
55
|
+
export declare const COLORMAP_VIRIDIS: ColormapTypes; // initializer: = 16
|
|
56
|
+
export declare const COLORMAP_CIVIDIS: ColormapTypes; // initializer: = 17
|
|
57
|
+
export declare const COLORMAP_TWILIGHT: ColormapTypes; // initializer: = 18
|
|
58
|
+
export declare const COLORMAP_TWILIGHT_SHIFTED: ColormapTypes; // initializer: = 19
|
|
59
|
+
export declare const COLORMAP_TURBO: ColormapTypes; // initializer: = 20
|
|
60
|
+
export declare const COLORMAP_DEEPGREEN: ColormapTypes; // initializer: = 21
|
|
@@ -65,9 +65,9 @@ export declare function boundingRect(array: InputArray): Rect;
|
|
|
65
65
|
*
|
|
66
66
|
* @param box The input rotated rectangle. It may be the output of
|
|
67
67
|
*
|
|
68
|
-
* @
|
|
68
|
+
* @returns An array of four vertices of the rectangle (Point2f[])
|
|
69
69
|
*/
|
|
70
|
-
export declare function boxPoints(box: RotatedRect
|
|
70
|
+
export declare function boxPoints(box: RotatedRect): Point2f[];
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
|
|
@@ -533,9 +533,7 @@ export declare function minAreaRect(points: InputArray): RotatedRect;
|
|
|
533
533
|
*
|
|
534
534
|
* @param points Input vector of 2D points, stored in std::vector<> or Mat
|
|
535
535
|
*/
|
|
536
|
-
export declare function minEnclosingCircle(
|
|
537
|
-
points: InputArray,
|
|
538
|
-
): Circle;
|
|
536
|
+
export declare function minEnclosingCircle(points: InputArray): Circle;
|
|
539
537
|
|
|
540
538
|
/**
|
|
541
539
|
* The function finds a triangle of minimum area enclosing the given set of 2D points and returns its
|
|
@@ -101,3 +101,9 @@ export declare const CASCADE_SCALE_IMAGE: any; // initializer: = 2
|
|
|
101
101
|
export declare const CASCADE_FIND_BIGGEST_OBJECT: any; // initializer: = 4
|
|
102
102
|
|
|
103
103
|
export declare const CASCADE_DO_ROUGH_SEARCH: any; // initializer: = 8
|
|
104
|
+
|
|
105
|
+
export { QRCodeDetector } from "./QRCodeDetector";
|
|
106
|
+
export {
|
|
107
|
+
QRCodeDetectorAruco,
|
|
108
|
+
QRCodeDetectorAruco_Params,
|
|
109
|
+
} from "./QRCodeDetectorAruco";
|