@opencvjs/types 4.10.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.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/lib/index.d.ts +2 -0
  4. package/lib/opencv/Affine3.d.ts +206 -0
  5. package/lib/opencv/Algorithm.d.ts +126 -0
  6. package/lib/opencv/AutoBuffer.d.ts +50 -0
  7. package/lib/opencv/BFMatcher.d.ts +37 -0
  8. package/lib/opencv/BOWTrainer.d.ts +43 -0
  9. package/lib/opencv/CascadeClassifier.d.ts +153 -0
  10. package/lib/opencv/DescriptorMatcher.d.ts +236 -0
  11. package/lib/opencv/DynamicBitset.d.ts +68 -0
  12. package/lib/opencv/Exception.d.ts +54 -0
  13. package/lib/opencv/Feature2D.d.ts +20 -0
  14. package/lib/opencv/FlannBasedMatcher.d.ts +57 -0
  15. package/lib/opencv/HOGDescriptor.d.ts +401 -0
  16. package/lib/opencv/Logger.d.ts +34 -0
  17. package/lib/opencv/LshTable.d.ts +81 -0
  18. package/lib/opencv/Mat.d.ts +1793 -0
  19. package/lib/opencv/MatExpr.d.ts +107 -0
  20. package/lib/opencv/MatOp.d.ts +72 -0
  21. package/lib/opencv/Matx.d.ts +228 -0
  22. package/lib/opencv/Node.d.ts +33 -0
  23. package/lib/opencv/ORB.d.ts +23 -0
  24. package/lib/opencv/PCA.d.ts +198 -0
  25. package/lib/opencv/RotatedRect.d.ts +73 -0
  26. package/lib/opencv/Tracker.d.ts +1 -0
  27. package/lib/opencv/TrackerMIL.d.ts +3 -0
  28. package/lib/opencv/_types.d.ts +48 -0
  29. package/lib/opencv/calib3d.d.ts +2937 -0
  30. package/lib/opencv/core_array.d.ts +3102 -0
  31. package/lib/opencv/core_cluster.d.ts +80 -0
  32. package/lib/opencv/core_hal_interface.d.ts +159 -0
  33. package/lib/opencv/core_utils.d.ts +748 -0
  34. package/lib/opencv/dnn.d.ts +505 -0
  35. package/lib/opencv/features2d_draw.d.ts +114 -0
  36. package/lib/opencv/fisheye.d.ts +26 -0
  37. package/lib/opencv/helpers.d.ts +274 -0
  38. package/lib/opencv/imgproc_color_conversions.d.ts +527 -0
  39. package/lib/opencv/imgproc_draw.d.ts +732 -0
  40. package/lib/opencv/imgproc_feature.d.ts +681 -0
  41. package/lib/opencv/imgproc_filter.d.ts +918 -0
  42. package/lib/opencv/imgproc_hist.d.ts +399 -0
  43. package/lib/opencv/imgproc_misc.d.ts +616 -0
  44. package/lib/opencv/imgproc_object.d.ts +58 -0
  45. package/lib/opencv/imgproc_shape.d.ts +724 -0
  46. package/lib/opencv/imgproc_transform.d.ts +574 -0
  47. package/lib/opencv/missing.d.ts +58 -0
  48. package/lib/opencv/objdetect.d.ts +103 -0
  49. package/lib/opencv/photo_inpaint.d.ts +39 -0
  50. package/lib/opencv/softdouble.d.ts +71 -0
  51. package/lib/opencv/softfloat.d.ts +71 -0
  52. package/lib/opencv/video_track.d.ts +370 -0
  53. package/package.json +18 -0
  54. package/tsconfig.json +15 -0
@@ -0,0 +1,918 @@
1
+ import type {
2
+ bool,
3
+ double,
4
+ InputArray,
5
+ int,
6
+ Mat,
7
+ OutputArray,
8
+ OutputArrayOfArrays,
9
+ Point,
10
+ Scalar,
11
+ Size,
12
+ TermCriteria,
13
+ } from "./_types";
14
+ /*
15
+ * # Image Filtering
16
+ * Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as [Mat]'s). It means that for each pixel location `$(x,y)$` in the source image (normally, rectangular), its neighborhood is considered and used to compute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of morphological operations, it is the minimum or maximum values, and so on. The computed response is stored in the destination image at the same location `$(x,y)$`. It means that the output image will be of the same size as the input image. Normally, the functions support multi-channel arrays, in which case every channel is processed independently. Therefore, the output image will also have the same number of channels as the input one.
17
+ *
18
+ * Another common feature of the functions and classes described in this section is that, unlike simple arithmetic functions, they need to extrapolate values of some non-existing pixels. For example, if you want to smooth an image using a Gaussian `$3 \times 3$` filter, then, when processing the left-most pixels in each row, you need pixels to the left of them, that is, outside of the image. You can let these pixels be the same as the left-most image pixels ("replicated
19
+ * border" extrapolation method), or assume that all the non-existing pixels are zeros ("constant
20
+ * border" extrapolation method), and so on. OpenCV enables you to specify the extrapolation method. For details, see [BorderTypes]
21
+ *
22
+ * <a name="d4/d86/group__imgproc__filter_1filter_depths"></a>
23
+ *
24
+ * ## Depth combinations
25
+ *
26
+ *
27
+ *
28
+ *
29
+ *
30
+ * when ddepth=-1, the output image will have the same depth as the source.
31
+ */
32
+ /**
33
+ * The function applies bilateral filtering to the input image, as described in bilateralFilter can
34
+ * reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared
35
+ * to most filters.
36
+ *
37
+ * Sigma values*: For simplicity, you can set the 2 sigma values to be the same. If they are small (<
38
+ * 10), the filter will not have much effect, whereas if they are large (> 150), they will have a very
39
+ * strong effect, making the image look "cartoonish".
40
+ *
41
+ * Filter size*: Large filters (d > 5) are very slow, so it is recommended to use d=5 for real-time
42
+ * applications, and perhaps d=9 for offline applications that need heavy noise filtering.
43
+ *
44
+ * This filter does not work inplace.
45
+ *
46
+ * @param src Source 8-bit or floating-point, 1-channel or 3-channel image.
47
+ *
48
+ * @param dst Destination image of the same size and type as src .
49
+ *
50
+ * @param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,
51
+ * it is computed from sigmaSpace.
52
+ *
53
+ * @param sigmaColor Filter sigma in the color space. A larger value of the parameter means that
54
+ * farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in
55
+ * larger areas of semi-equal color.
56
+ *
57
+ * @param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that
58
+ * farther pixels will influence each other as long as their colors are close enough (see sigmaColor ).
59
+ * When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional
60
+ * to sigmaSpace.
61
+ *
62
+ * @param borderType border mode used to extrapolate pixels outside of the image, see BorderTypes
63
+ */
64
+ export declare function bilateralFilter(
65
+ src: InputArray,
66
+ dst: OutputArray,
67
+ d: int,
68
+ sigmaColor: double,
69
+ sigmaSpace: double,
70
+ borderType?: int,
71
+ ): void;
72
+
73
+ /**
74
+ * The function smooths an image using the kernel:
75
+ *
76
+ * `\\[\\texttt{K} = \\frac{1}{\\texttt{ksize.width*ksize.height}} \\begin{bmatrix} 1 & 1 & 1 & \\cdots
77
+ * & 1 & 1 \\\\ 1 & 1 & 1 & \\cdots & 1 & 1 \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 & \\cdots & 1 & 1 \\\\
78
+ * \\end{bmatrix}\\]`
79
+ *
80
+ * The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst,
81
+ * src.type(), anchor, true, borderType)`.
82
+ *
83
+ * [boxFilter], [bilateralFilter], [GaussianBlur], [medianBlur]
84
+ *
85
+ * @param src input image; it can have any number of channels, which are processed independently, but
86
+ * the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
87
+ *
88
+ * @param dst output image of the same size and type as src.
89
+ *
90
+ * @param ksize blurring kernel size.
91
+ *
92
+ * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
93
+ * center.
94
+ *
95
+ * @param borderType border mode used to extrapolate pixels outside of the image, see BorderTypes
96
+ */
97
+ export declare function blur(
98
+ src: InputArray,
99
+ dst: OutputArray,
100
+ ksize: Size,
101
+ anchor?: Point,
102
+ borderType?: int,
103
+ ): void;
104
+
105
+ /**
106
+ * The function smooths an image using the kernel:
107
+ *
108
+ * `\\[\\texttt{K} = \\alpha \\begin{bmatrix} 1 & 1 & 1 & \\cdots & 1 & 1 \\\\ 1 & 1 & 1 & \\cdots & 1
109
+ * & 1 \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 & \\cdots & 1 & 1 \\end{bmatrix}\\]`
110
+ *
111
+ * where
112
+ *
113
+ * `\\[\\alpha = \\fork{\\frac{1}{\\texttt{ksize.width*ksize.height}}}{when
114
+ * \\texttt{normalize=true}}{1}{otherwise}\\]`
115
+ *
116
+ * Unnormalized box filter is useful for computing various integral characteristics over each pixel
117
+ * neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
118
+ * algorithms, and so on). If you need to compute pixel sums over variable-size windows, use
119
+ * [integral].
120
+ *
121
+ * [blur], [bilateralFilter], [GaussianBlur], [medianBlur], [integral]
122
+ *
123
+ * @param src input image.
124
+ *
125
+ * @param dst output image of the same size and type as src.
126
+ *
127
+ * @param ddepth the output image depth (-1 to use src.depth()).
128
+ *
129
+ * @param ksize blurring kernel size.
130
+ *
131
+ * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
132
+ * center.
133
+ *
134
+ * @param normalize flag, specifying whether the kernel is normalized by its area or not.
135
+ *
136
+ * @param borderType border mode used to extrapolate pixels outside of the image, see BorderTypes
137
+ */
138
+ export declare function boxFilter(
139
+ src: InputArray,
140
+ dst: OutputArray,
141
+ ddepth: int,
142
+ ksize: Size,
143
+ anchor?: Point,
144
+ normalize?: bool,
145
+ borderType?: int,
146
+ ): void;
147
+
148
+ /**
149
+ * The function constructs a vector of images and builds the Gaussian pyramid by recursively applying
150
+ * pyrDown to the previously built pyramid layers, starting from `dst[0]==src`.
151
+ *
152
+ * @param src Source image. Check pyrDown for the list of supported types.
153
+ *
154
+ * @param dst Destination vector of maxlevel+1 images of the same type as src. dst[0] will be the same
155
+ * as src. dst[1] is the next pyramid layer, a smoothed and down-sized src, and so on.
156
+ *
157
+ * @param maxlevel 0-based index of the last (the smallest) pyramid layer. It must be non-negative.
158
+ *
159
+ * @param borderType Pixel extrapolation method, see BorderTypes (BORDER_CONSTANT isn't supported)
160
+ */
161
+ export declare function buildPyramid(
162
+ src: InputArray,
163
+ dst: OutputArrayOfArrays,
164
+ maxlevel: int,
165
+ borderType?: int,
166
+ ): void;
167
+
168
+ /**
169
+ * The function dilates the source image using the specified structuring element that determines the
170
+ * shape of a pixel neighborhood over which the maximum is taken: `\\[\\texttt{dst} (x,y) = \\max
171
+ * _{(x',y'): \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\]`
172
+ *
173
+ * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
174
+ * case of multi-channel images, each channel is processed independently.
175
+ *
176
+ * [erode], [morphologyEx], [getStructuringElement]
177
+ *
178
+ * @param src input image; the number of channels can be arbitrary, but the depth should be one of
179
+ * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
180
+ *
181
+ * @param dst output image of the same size and type as src.
182
+ *
183
+ * @param kernel structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular
184
+ * structuring element is used. Kernel can be created using getStructuringElement
185
+ *
186
+ * @param anchor position of the anchor within the element; default value (-1, -1) means that the
187
+ * anchor is at the element center.
188
+ *
189
+ * @param iterations number of times dilation is applied.
190
+ *
191
+ * @param borderType pixel extrapolation method, see BorderTypes
192
+ *
193
+ * @param borderValue border value in case of a constant border
194
+ */
195
+ export declare function dilate(
196
+ src: InputArray,
197
+ dst: OutputArray,
198
+ kernel: InputArray,
199
+ anchor?: Point,
200
+ iterations?: int,
201
+ borderType?: int,
202
+ borderValue?: any,
203
+ ): void;
204
+
205
+ /**
206
+ * The function erodes the source image using the specified structuring element that determines the
207
+ * shape of a pixel neighborhood over which the minimum is taken:
208
+ *
209
+ * `\\[\\texttt{dst} (x,y) = \\min _{(x',y'): \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src}
210
+ * (x+x',y+y')\\]`
211
+ *
212
+ * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
213
+ * case of multi-channel images, each channel is processed independently.
214
+ *
215
+ * [dilate], [morphologyEx], [getStructuringElement]
216
+ *
217
+ * @param src input image; the number of channels can be arbitrary, but the depth should be one of
218
+ * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
219
+ *
220
+ * @param dst output image of the same size and type as src.
221
+ *
222
+ * @param kernel structuring element used for erosion; if element=Mat(), a 3 x 3 rectangular
223
+ * structuring element is used. Kernel can be created using getStructuringElement.
224
+ *
225
+ * @param anchor position of the anchor within the element; default value (-1, -1) means that the
226
+ * anchor is at the element center.
227
+ *
228
+ * @param iterations number of times erosion is applied.
229
+ *
230
+ * @param borderType pixel extrapolation method, see BorderTypes
231
+ *
232
+ * @param borderValue border value in case of a constant border
233
+ */
234
+ export declare function erode(
235
+ src: InputArray,
236
+ dst: OutputArray,
237
+ kernel: InputArray,
238
+ anchor?: Point,
239
+ iterations?: int,
240
+ borderType?: int,
241
+ borderValue?: any,
242
+ ): void;
243
+
244
+ /**
245
+ * The function applies an arbitrary linear filter to an image. In-place operation is supported. When
246
+ * the aperture is partially outside the image, the function interpolates outlier pixel values
247
+ * according to the specified border mode.
248
+ *
249
+ * The function does actually compute correlation, not the convolution:
250
+ *
251
+ * `\\[\\texttt{dst} (x,y) = \\sum _{ \\stackrel{0\\leq x' < \\texttt{kernel.cols},}{0\\leq y' <
252
+ * \\texttt{kernel.rows}} } \\texttt{kernel} (x',y')* \\texttt{src} (x+x'- \\texttt{anchor.x} ,y+y'-
253
+ * \\texttt{anchor.y} )\\]`
254
+ *
255
+ * That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
256
+ * the kernel using [flip] and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
257
+ * anchor.y - 1)`.
258
+ *
259
+ * The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
260
+ * larger) and the direct algorithm for small kernels.
261
+ *
262
+ * [sepFilter2D], [dft], [matchTemplate]
263
+ *
264
+ * @param src input image.
265
+ *
266
+ * @param dst output image of the same size and the same number of channels as src.
267
+ *
268
+ * @param ddepth desired depth of the destination image, see combinations
269
+ *
270
+ * @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
271
+ * matrix; if you want to apply different kernels to different channels, split the image into separate
272
+ * color planes using split and process them individually.
273
+ *
274
+ * @param anchor anchor of the kernel that indicates the relative position of a filtered point within
275
+ * the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is
276
+ * at the kernel center.
277
+ *
278
+ * @param delta optional value added to the filtered pixels before storing them in dst.
279
+ *
280
+ * @param borderType pixel extrapolation method, see BorderTypes
281
+ */
282
+ export declare function filter2D(
283
+ src: InputArray,
284
+ dst: OutputArray,
285
+ ddepth: int,
286
+ kernel: InputArray,
287
+ anchor?: Point,
288
+ delta?: double,
289
+ borderType?: int,
290
+ ): void;
291
+
292
+ /**
293
+ * The function convolves the source image with the specified Gaussian kernel. In-place filtering is
294
+ * supported.
295
+ *
296
+ * [sepFilter2D], [filter2D], [blur], [boxFilter], [bilateralFilter], [medianBlur]
297
+ *
298
+ * @param src input image; the image can have any number of channels, which are processed
299
+ * independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
300
+ *
301
+ * @param dst output image of the same size and type as src.
302
+ *
303
+ * @param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be
304
+ * positive and odd. Or, they can be zero's and then they are computed from sigma.
305
+ *
306
+ * @param sigmaX Gaussian kernel standard deviation in X direction.
307
+ *
308
+ * @param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be
309
+ * equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,
310
+ * respectively (see getGaussianKernel for details); to fully control the result regardless of possible
311
+ * future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and
312
+ * sigmaY.
313
+ *
314
+ * @param borderType pixel extrapolation method, see BorderTypes
315
+ */
316
+ export declare function GaussianBlur(
317
+ src: InputArray,
318
+ dst: OutputArray,
319
+ ksize: Size,
320
+ sigmaX: double,
321
+ sigmaY?: double,
322
+ borderType?: int,
323
+ ): void;
324
+
325
+ /**
326
+ * The function computes and returns the filter coefficients for spatial image derivatives. When
327
+ * `ksize=FILTER_SCHARR`, the Scharr `$3 \\times 3$` kernels are generated (see [Scharr]). Otherwise,
328
+ * Sobel kernels are generated (see [Sobel]). The filters are normally passed to [sepFilter2D] or to
329
+ *
330
+ * @param kx Output matrix of row filter coefficients. It has the type ktype .
331
+ *
332
+ * @param ky Output matrix of column filter coefficients. It has the type ktype .
333
+ *
334
+ * @param dx Derivative order in respect of x.
335
+ *
336
+ * @param dy Derivative order in respect of y.
337
+ *
338
+ * @param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
339
+ *
340
+ * @param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.
341
+ * Theoretically, the coefficients should have the denominator $=2^{ksize*2-dx-dy-2}$. If you are going
342
+ * to filter floating-point images, you are likely to use the normalized kernels. But if you compute
343
+ * derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve all the
344
+ * fractional bits, you may want to set normalize=false .
345
+ *
346
+ * @param ktype Type of filter coefficients. It can be CV_32f or CV_64F .
347
+ */
348
+ export declare function getDerivKernels(
349
+ kx: OutputArray,
350
+ ky: OutputArray,
351
+ dx: int,
352
+ dy: int,
353
+ ksize: int,
354
+ normalize?: bool,
355
+ ktype?: int,
356
+ ): void;
357
+
358
+ /**
359
+ * For more details about gabor filter equations and parameters, see: .
360
+ *
361
+ * @param ksize Size of the filter returned.
362
+ *
363
+ * @param sigma Standard deviation of the gaussian envelope.
364
+ *
365
+ * @param theta Orientation of the normal to the parallel stripes of a Gabor function.
366
+ *
367
+ * @param lambd Wavelength of the sinusoidal factor.
368
+ *
369
+ * @param gamma Spatial aspect ratio.
370
+ *
371
+ * @param psi Phase offset.
372
+ *
373
+ * @param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
374
+ */
375
+ export declare function getGaborKernel(
376
+ ksize: Size,
377
+ sigma: double,
378
+ theta: double,
379
+ lambd: double,
380
+ gamma: double,
381
+ psi?: double,
382
+ ktype?: int,
383
+ ): Mat;
384
+
385
+ /**
386
+ * The function computes and returns the `$\\texttt{ksize} \\times 1$` matrix of Gaussian filter
387
+ * coefficients:
388
+ *
389
+ * `\\[G_i= \\alpha *e^{-(i-( \\texttt{ksize} -1)/2)^2/(2* \\texttt{sigma}^2)},\\]`
390
+ *
391
+ * where `$i=0..\\texttt{ksize}-1$` and `$\\alpha$` is the scale factor chosen so that `$\\sum_i
392
+ * G_i=1$`.
393
+ *
394
+ * Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize
395
+ * smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.
396
+ * You may also use the higher-level GaussianBlur.
397
+ *
398
+ * [sepFilter2D], [getDerivKernels], [getStructuringElement], [GaussianBlur]
399
+ *
400
+ * @param ksize Aperture size. It should be odd ( $\texttt{ksize} \mod 2 = 1$ ) and positive.
401
+ *
402
+ * @param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as sigma
403
+ * = 0.3*((ksize-1)*0.5 - 1) + 0.8.
404
+ *
405
+ * @param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
406
+ */
407
+ export declare function getGaussianKernel(
408
+ ksize: int,
409
+ sigma: double,
410
+ ktype?: int,
411
+ ): Mat;
412
+
413
+ /**
414
+ * The function constructs and returns the structuring element that can be further passed to [erode],
415
+ * [dilate] or [morphologyEx]. But you can also construct an arbitrary binary mask yourself and use it
416
+ * as the structuring element.
417
+ *
418
+ * @param shape Element shape that could be one of MorphShapes
419
+ *
420
+ * @param ksize Size of the structuring element.
421
+ *
422
+ * @param anchor Anchor position within the element. The default value $(-1, -1)$ means that the anchor
423
+ * is at the center. Note that only the shape of a cross-shaped element depends on the anchor position.
424
+ * In other cases the anchor just regulates how much the result of the morphological operation is
425
+ * shifted.
426
+ */
427
+ export declare function getStructuringElement(
428
+ shape: int,
429
+ ksize: Size,
430
+ anchor?: Point,
431
+ ): Mat;
432
+
433
+ /**
434
+ * The function calculates the Laplacian of the source image by adding up the second x and y
435
+ * derivatives calculated using the Sobel operator:
436
+ *
437
+ * `\\[\\texttt{dst} = \\Delta \\texttt{src} = \\frac{\\partial^2 \\texttt{src}}{\\partial x^2} +
438
+ * \\frac{\\partial^2 \\texttt{src}}{\\partial y^2}\\]`
439
+ *
440
+ * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
441
+ * with the following `$3 \\times 3$` aperture:
442
+ *
443
+ * `\\[\\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\\]`
444
+ *
445
+ * [Sobel], [Scharr]
446
+ *
447
+ * @param src Source image.
448
+ *
449
+ * @param dst Destination image of the same size and the same number of channels as src .
450
+ *
451
+ * @param ddepth Desired depth of the destination image.
452
+ *
453
+ * @param ksize Aperture size used to compute the second-derivative filters. See getDerivKernels for
454
+ * details. The size must be positive and odd.
455
+ *
456
+ * @param scale Optional scale factor for the computed Laplacian values. By default, no scaling is
457
+ * applied. See getDerivKernels for details.
458
+ *
459
+ * @param delta Optional delta value that is added to the results prior to storing them in dst .
460
+ *
461
+ * @param borderType Pixel extrapolation method, see BorderTypes
462
+ */
463
+ export declare function Laplacian(
464
+ src: InputArray,
465
+ dst: OutputArray,
466
+ ddepth: int,
467
+ ksize?: int,
468
+ scale?: double,
469
+ delta?: double,
470
+ borderType?: int,
471
+ ): void;
472
+
473
+ /**
474
+ * The function smoothes an image using the median filter with the `$\\texttt{ksize} \\times
475
+ * \\texttt{ksize}$` aperture. Each channel of a multi-channel image is processed independently.
476
+ * In-place operation is supported.
477
+ *
478
+ * The median filter uses [BORDER_REPLICATE] internally to cope with border pixels, see [BorderTypes]
479
+ *
480
+ * [bilateralFilter], [blur], [boxFilter], [GaussianBlur]
481
+ *
482
+ * @param src input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U,
483
+ * CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
484
+ *
485
+ * @param dst destination array of the same size and type as src.
486
+ *
487
+ * @param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
488
+ */
489
+ export declare function medianBlur(
490
+ src: InputArray,
491
+ dst: OutputArray,
492
+ ksize: int,
493
+ ): void;
494
+
495
+ export declare function morphologyDefaultBorderValue(): Scalar;
496
+
497
+ /**
498
+ * The function [cv::morphologyEx] can perform advanced morphological transformations using an erosion
499
+ * and dilation as basic operations.
500
+ *
501
+ * Any of the operations can be done in-place. In case of multi-channel images, each channel is
502
+ * processed independently.
503
+ *
504
+ * [dilate], [erode], [getStructuringElement]
505
+ *
506
+ * The number of iterations is the number of times erosion or dilatation operation will be applied. For
507
+ * instance, an opening operation ([MORPH_OPEN]) with two iterations is equivalent to apply
508
+ * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
509
+ *
510
+ * @param src Source image. The number of channels can be arbitrary. The depth should be one of CV_8U,
511
+ * CV_16U, CV_16S, CV_32F or CV_64F.
512
+ *
513
+ * @param dst Destination image of the same size and type as source image.
514
+ *
515
+ * @param op Type of a morphological operation, see MorphTypes
516
+ *
517
+ * @param kernel Structuring element. It can be created using getStructuringElement.
518
+ *
519
+ * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the kernel
520
+ * center.
521
+ *
522
+ * @param iterations Number of times erosion and dilation are applied.
523
+ *
524
+ * @param borderType Pixel extrapolation method, see BorderTypes
525
+ *
526
+ * @param borderValue Border value in case of a constant border. The default value has a special
527
+ * meaning.
528
+ */
529
+ export declare function morphologyEx(
530
+ src: InputArray,
531
+ dst: OutputArray,
532
+ op: int | MorphTypes,
533
+ kernel: InputArray,
534
+ anchor?: Point,
535
+ iterations?: int,
536
+ borderType?: int,
537
+ borderValue?: any,
538
+ ): void;
539
+
540
+ /**
541
+ * By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
542
+ * any case, the following conditions should be satisfied:
543
+ *
544
+ * `\\[\\begin{array}{l} | \\texttt{dstsize.width} *2-src.cols| \\leq 2 \\\\ | \\texttt{dstsize.height}
545
+ * *2-src.rows| \\leq 2 \\end{array}\\]`
546
+ *
547
+ * The function performs the downsampling step of the Gaussian pyramid construction. First, it
548
+ * convolves the source image with the kernel:
549
+ *
550
+ * `\\[\\frac{1}{256} \\begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\\\ 4 & 16 & 24 & 16 & 4 \\\\ 6 & 24 & 36 &
551
+ * 24 & 6 \\\\ 4 & 16 & 24 & 16 & 4 \\\\ 1 & 4 & 6 & 4 & 1 \\end{bmatrix}\\]`
552
+ *
553
+ * Then, it downsamples the image by rejecting even rows and columns.
554
+ *
555
+ * @param src input image.
556
+ *
557
+ * @param dst output image; it has the specified size and the same type as src.
558
+ *
559
+ * @param dstsize size of the output image.
560
+ *
561
+ * @param borderType Pixel extrapolation method, see BorderTypes (BORDER_CONSTANT isn't supported)
562
+ */
563
+ export declare function pyrDown(
564
+ src: InputArray,
565
+ dst: OutputArray,
566
+ dstsize?: any,
567
+ borderType?: int,
568
+ ): void;
569
+
570
+ /**
571
+ * The function implements the filtering stage of meanshift segmentation, that is, the output of the
572
+ * function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
573
+ * At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
574
+ * meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
575
+ * considered:
576
+ *
577
+ * `\\[(x,y): X- \\texttt{sp} \\le x \\le X+ \\texttt{sp} , Y- \\texttt{sp} \\le y \\le Y+ \\texttt{sp}
578
+ * , ||(R,G,B)-(r,g,b)|| \\le \\texttt{sr}\\]`
579
+ *
580
+ * where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
581
+ * (though, the algorithm does not depend on the color space used, so any 3-component color space can
582
+ * be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
583
+ * (R',G',B') are found and they act as the neighborhood center on the next iteration:
584
+ *
585
+ * `\\[(X,Y)~(X',Y'), (R,G,B)~(R',G',B').\\]`
586
+ *
587
+ * After the iterations over, the color components of the initial pixel (that is, the pixel from where
588
+ * the iterations started) are set to the final value (average color at the last iteration):
589
+ *
590
+ * `\\[I(X,Y) <- (R*,G*,B*)\\]`
591
+ *
592
+ * When maxLevel > 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
593
+ * run on the smallest layer first. After that, the results are propagated to the larger layer and the
594
+ * iterations are run again only on those pixels where the layer colors differ by more than sr from the
595
+ * lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
596
+ * results will be actually different from the ones obtained by running the meanshift procedure on the
597
+ * whole original image (i.e. when maxLevel==0).
598
+ *
599
+ * @param src The source 8-bit, 3-channel image.
600
+ *
601
+ * @param dst The destination image of the same format and the same size as the source.
602
+ *
603
+ * @param sp The spatial window radius.
604
+ *
605
+ * @param sr The color window radius.
606
+ *
607
+ * @param maxLevel Maximum level of the pyramid for the segmentation.
608
+ *
609
+ * @param termcrit Termination criteria: when to stop meanshift iterations.
610
+ */
611
+ export declare function pyrMeanShiftFiltering(
612
+ src: InputArray,
613
+ dst: OutputArray,
614
+ sp: double,
615
+ sr: double,
616
+ maxLevel?: int,
617
+ termcrit?: TermCriteria,
618
+ ): void;
619
+
620
+ /**
621
+ * By default, size of the output image is computed as `Size(src.cols\\*2, (src.rows\\*2)`, but in any
622
+ * case, the following conditions should be satisfied:
623
+ *
624
+ * `\\[\\begin{array}{l} | \\texttt{dstsize.width} -src.cols*2| \\leq ( \\texttt{dstsize.width} \\mod
625
+ * 2) \\\\ | \\texttt{dstsize.height} -src.rows*2| \\leq ( \\texttt{dstsize.height} \\mod 2)
626
+ * \\end{array}\\]`
627
+ *
628
+ * The function performs the upsampling step of the Gaussian pyramid construction, though it can
629
+ * actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
630
+ * injecting even zero rows and columns and then convolves the result with the same kernel as in
631
+ * pyrDown multiplied by 4.
632
+ *
633
+ * @param src input image.
634
+ *
635
+ * @param dst output image. It has the specified size and the same type as src .
636
+ *
637
+ * @param dstsize size of the output image.
638
+ *
639
+ * @param borderType Pixel extrapolation method, see BorderTypes (only BORDER_DEFAULT is supported)
640
+ */
641
+ export declare function pyrUp(
642
+ src: InputArray,
643
+ dst: OutputArray,
644
+ dstsize?: any,
645
+ borderType?: int,
646
+ ): void;
647
+
648
+ /**
649
+ * The function computes the first x- or y- spatial image derivative using the Scharr operator. The
650
+ * call
651
+ *
652
+ * `\\[\\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\\]`
653
+ *
654
+ * is equivalent to
655
+ *
656
+ * `\\[\\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\\]`
657
+ *
658
+ * [cartToPolar]
659
+ *
660
+ * @param src input image.
661
+ *
662
+ * @param dst output image of the same size and the same number of channels as src.
663
+ *
664
+ * @param ddepth output image depth, see combinations
665
+ *
666
+ * @param dx order of the derivative x.
667
+ *
668
+ * @param dy order of the derivative y.
669
+ *
670
+ * @param scale optional scale factor for the computed derivative values; by default, no scaling is
671
+ * applied (see getDerivKernels for details).
672
+ *
673
+ * @param delta optional delta value that is added to the results prior to storing them in dst.
674
+ *
675
+ * @param borderType pixel extrapolation method, see BorderTypes
676
+ */
677
+ export declare function Scharr(
678
+ src: InputArray,
679
+ dst: OutputArray,
680
+ ddepth: int,
681
+ dx: int,
682
+ dy: int,
683
+ scale?: double,
684
+ delta?: double,
685
+ borderType?: int,
686
+ ): void;
687
+
688
+ /**
689
+ * The function applies a separable linear filter to the image. That is, first, every row of src is
690
+ * filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel
691
+ * kernelY. The final result shifted by delta is stored in dst .
692
+ *
693
+ * [filter2D], [Sobel], [GaussianBlur], [boxFilter], [blur]
694
+ *
695
+ * @param src Source image.
696
+ *
697
+ * @param dst Destination image of the same size and the same number of channels as src .
698
+ *
699
+ * @param ddepth Destination image depth, see combinations
700
+ *
701
+ * @param kernelX Coefficients for filtering each row.
702
+ *
703
+ * @param kernelY Coefficients for filtering each column.
704
+ *
705
+ * @param anchor Anchor position within the kernel. The default value $(-1,-1)$ means that the anchor
706
+ * is at the kernel center.
707
+ *
708
+ * @param delta Value added to the filtered results before storing them.
709
+ *
710
+ * @param borderType Pixel extrapolation method, see BorderTypes
711
+ */
712
+ export declare function sepFilter2D(
713
+ src: InputArray,
714
+ dst: OutputArray,
715
+ ddepth: int,
716
+ kernelX: InputArray,
717
+ kernelY: InputArray,
718
+ anchor?: Point,
719
+ delta?: double,
720
+ borderType?: int,
721
+ ): void;
722
+
723
+ /**
724
+ * In all cases except one, the `$\\texttt{ksize} \\times \\texttt{ksize}$` separable kernel is used to
725
+ * calculate the derivative. When `$\\texttt{ksize = 1}$`, the `$3 \\times 1$` or `$1 \\times 3$`
726
+ * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
727
+ * or the second x- or y- derivatives.
728
+ *
729
+ * There is also the special value `ksize = [FILTER_SCHARR] (-1)` that corresponds to the `$3\\times3$`
730
+ * Scharr filter that may give more accurate results than the `$3\\times3$` Sobel. The Scharr aperture
731
+ * is
732
+ *
733
+ * `\\[\\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\\]`
734
+ *
735
+ * for the x-derivative, or transposed for the y-derivative.
736
+ *
737
+ * The function calculates an image derivative by convolving the image with the appropriate kernel:
738
+ *
739
+ * `\\[\\texttt{dst} = \\frac{\\partial^{xorder+yorder} \\texttt{src}}{\\partial x^{xorder} \\partial
740
+ * y^{yorder}}\\]`
741
+ *
742
+ * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
743
+ * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
744
+ * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
745
+ * case corresponds to a kernel of:
746
+ *
747
+ * `\\[\\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\\]`
748
+ *
749
+ * The second case corresponds to a kernel of:
750
+ *
751
+ * `\\[\\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\\]`
752
+ *
753
+ * [Scharr], [Laplacian], [sepFilter2D], [filter2D], [GaussianBlur], [cartToPolar]
754
+ *
755
+ * @param src input image.
756
+ *
757
+ * @param dst output image of the same size and the same number of channels as src .
758
+ *
759
+ * @param ddepth output image depth, see combinations; in the case of 8-bit input images it will result
760
+ * in truncated derivatives.
761
+ *
762
+ * @param dx order of the derivative x.
763
+ *
764
+ * @param dy order of the derivative y.
765
+ *
766
+ * @param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
767
+ *
768
+ * @param scale optional scale factor for the computed derivative values; by default, no scaling is
769
+ * applied (see getDerivKernels for details).
770
+ *
771
+ * @param delta optional delta value that is added to the results prior to storing them in dst.
772
+ *
773
+ * @param borderType pixel extrapolation method, see BorderTypes
774
+ */
775
+ export declare function Sobel(
776
+ src: InputArray,
777
+ dst: OutputArray,
778
+ ddepth: int,
779
+ dx: int,
780
+ dy: int,
781
+ ksize?: int,
782
+ scale?: double,
783
+ delta?: double,
784
+ borderType?: int,
785
+ ): void;
786
+
787
+ /**
788
+ * Equivalent to calling:
789
+ *
790
+ * ```cpp
791
+ * Sobel( src, dx, CV_16SC1, 1, 0, 3 );
792
+ * Sobel( src, dy, CV_16SC1, 0, 1, 3 );
793
+ * ```
794
+ *
795
+ * [Sobel]
796
+ *
797
+ * @param src input image.
798
+ *
799
+ * @param dx output image with first-order derivative in x.
800
+ *
801
+ * @param dy output image with first-order derivative in y.
802
+ *
803
+ * @param ksize size of Sobel kernel. It must be 3.
804
+ *
805
+ * @param borderType pixel extrapolation method, see BorderTypes
806
+ */
807
+ export declare function spatialGradient(
808
+ src: InputArray,
809
+ dx: OutputArray,
810
+ dy: OutputArray,
811
+ ksize?: int,
812
+ borderType?: int,
813
+ ): void;
814
+
815
+ /**
816
+ * For every pixel `$ (x, y) $` in the source image, the function calculates the sum of squares of
817
+ * those neighboring pixel values which overlap the filter placed over the pixel `$ (x, y) $`.
818
+ *
819
+ * The unnormalized square box filter can be useful in computing local image statistics such as the the
820
+ * local variance and standard deviation around the neighborhood of a pixel.
821
+ *
822
+ * [boxFilter]
823
+ *
824
+ * @param src input image
825
+ *
826
+ * @param dst output image of the same size and type as _src
827
+ *
828
+ * @param ddepth the output image depth (-1 to use src.depth())
829
+ *
830
+ * @param ksize kernel size
831
+ *
832
+ * @param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at
833
+ * the kernel center.
834
+ *
835
+ * @param normalize flag, specifying whether the kernel is to be normalized by it's area or not.
836
+ *
837
+ * @param borderType border mode used to extrapolate pixels outside of the image, see BorderTypes
838
+ */
839
+ export declare function sqrBoxFilter(
840
+ src: InputArray,
841
+ dst: OutputArray,
842
+ ddepth: int,
843
+ ksize: Size,
844
+ anchor?: Point,
845
+ normalize?: bool,
846
+ borderType?: int,
847
+ ): void;
848
+
849
+ export declare const MORPH_RECT: MorphShapes; // initializer: = 0
850
+
851
+ /**
852
+ * a cross-shaped structuring element: `\\[E_{ij} = \\fork{1}{if i=\\texttt{anchor.y} or
853
+ * j=\\texttt{anchor.x}}{0}{otherwise}\\]`
854
+ *
855
+ */
856
+ export declare const MORPH_CROSS: MorphShapes; // initializer: = 1
857
+
858
+ /**
859
+ * an elliptic structuring element, that is, a filled ellipse inscribed into the rectangle Rect(0, 0,
860
+ * esize.width, 0.esize.height)
861
+ *
862
+ */
863
+ export declare const MORPH_ELLIPSE: MorphShapes; // initializer: = 2
864
+
865
+ export declare const MORPH_ERODE: MorphTypes; // initializer: = 0
866
+
867
+ export declare const MORPH_DILATE: MorphTypes; // initializer: = 1
868
+
869
+ /**
870
+ * an opening operation `\\[\\texttt{dst} = \\mathrm{open} ( \\texttt{src} , \\texttt{element} )=
871
+ * \\mathrm{dilate} ( \\mathrm{erode} ( \\texttt{src} , \\texttt{element} ))\\]`
872
+ *
873
+ */
874
+ export declare const MORPH_OPEN: MorphTypes; // initializer: = 2
875
+
876
+ /**
877
+ * a closing operation `\\[\\texttt{dst} = \\mathrm{close} ( \\texttt{src} , \\texttt{element} )=
878
+ * \\mathrm{erode} ( \\mathrm{dilate} ( \\texttt{src} , \\texttt{element} ))\\]`
879
+ *
880
+ */
881
+ export declare const MORPH_CLOSE: MorphTypes; // initializer: = 3
882
+
883
+ /**
884
+ * a morphological gradient `\\[\\texttt{dst} = \\mathrm{morph\\_grad} ( \\texttt{src} ,
885
+ * \\texttt{element} )= \\mathrm{dilate} ( \\texttt{src} , \\texttt{element} )- \\mathrm{erode} (
886
+ * \\texttt{src} , \\texttt{element} )\\]`
887
+ *
888
+ */
889
+ export declare const MORPH_GRADIENT: MorphTypes; // initializer: = 4
890
+
891
+ /**
892
+ * "top hat" `\\[\\texttt{dst} = \\mathrm{tophat} ( \\texttt{src} , \\texttt{element} )= \\texttt{src}
893
+ * - \\mathrm{open} ( \\texttt{src} , \\texttt{element} )\\]`
894
+ *
895
+ */
896
+ export declare const MORPH_TOPHAT: MorphTypes; // initializer: = 5
897
+
898
+ /**
899
+ * "black hat" `\\[\\texttt{dst} = \\mathrm{blackhat} ( \\texttt{src} , \\texttt{element} )=
900
+ * \\mathrm{close} ( \\texttt{src} , \\texttt{element} )- \\texttt{src}\\]`
901
+ *
902
+ */
903
+ export declare const MORPH_BLACKHAT: MorphTypes; // initializer: = 6
904
+
905
+ /**
906
+ * "hit or miss" .- Only supported for CV_8UC1 binary images. A tutorial can be found in the
907
+ * documentation
908
+ *
909
+ */
910
+ export declare const MORPH_HITMISS: MorphTypes; // initializer: = 7
911
+
912
+ export declare const FILTER_SCHARR: SpecialFilter; // initializer: = -1
913
+
914
+ export type MorphShapes = any;
915
+
916
+ export type MorphTypes = any;
917
+
918
+ export type SpecialFilter = any;