node-native-win-utils 1.1.1 → 1.3.0

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 (174) hide show
  1. package/README.md +144 -27
  2. package/binding.gyp +18 -5
  3. package/dist/index.d.ts +146 -4
  4. package/dist/index.js +107 -3
  5. package/include/opencv2/core/affine.hpp +678 -0
  6. package/include/opencv2/core/async.hpp +105 -0
  7. package/include/opencv2/core/base.hpp +664 -0
  8. package/include/opencv2/core/bindings_utils.hpp +325 -0
  9. package/include/opencv2/core/bufferpool.hpp +40 -0
  10. package/include/opencv2/core/check.hpp +170 -0
  11. package/include/opencv2/core/core.hpp +48 -0
  12. package/include/opencv2/core/core_c.h +3128 -0
  13. package/include/opencv2/core/cuda/block.hpp +211 -0
  14. package/include/opencv2/core/cuda/border_interpolate.hpp +722 -0
  15. package/include/opencv2/core/cuda/color.hpp +309 -0
  16. package/include/opencv2/core/cuda/common.hpp +131 -0
  17. package/include/opencv2/core/cuda/datamov_utils.hpp +113 -0
  18. package/include/opencv2/core/cuda/detail/color_detail.hpp +2018 -0
  19. package/include/opencv2/core/cuda/detail/reduce.hpp +365 -0
  20. package/include/opencv2/core/cuda/detail/reduce_key_val.hpp +502 -0
  21. package/include/opencv2/core/cuda/detail/transform_detail.hpp +392 -0
  22. package/include/opencv2/core/cuda/detail/type_traits_detail.hpp +191 -0
  23. package/include/opencv2/core/cuda/detail/vec_distance_detail.hpp +121 -0
  24. package/include/opencv2/core/cuda/dynamic_smem.hpp +88 -0
  25. package/include/opencv2/core/cuda/emulation.hpp +269 -0
  26. package/include/opencv2/core/cuda/filters.hpp +293 -0
  27. package/include/opencv2/core/cuda/funcattrib.hpp +79 -0
  28. package/include/opencv2/core/cuda/functional.hpp +805 -0
  29. package/include/opencv2/core/cuda/limits.hpp +128 -0
  30. package/include/opencv2/core/cuda/reduce.hpp +209 -0
  31. package/include/opencv2/core/cuda/saturate_cast.hpp +292 -0
  32. package/include/opencv2/core/cuda/scan.hpp +258 -0
  33. package/include/opencv2/core/cuda/simd_functions.hpp +869 -0
  34. package/include/opencv2/core/cuda/transform.hpp +75 -0
  35. package/include/opencv2/core/cuda/type_traits.hpp +90 -0
  36. package/include/opencv2/core/cuda/utility.hpp +230 -0
  37. package/include/opencv2/core/cuda/vec_distance.hpp +232 -0
  38. package/include/opencv2/core/cuda/vec_math.hpp +923 -0
  39. package/include/opencv2/core/cuda/vec_traits.hpp +288 -0
  40. package/include/opencv2/core/cuda/warp.hpp +139 -0
  41. package/include/opencv2/core/cuda/warp_reduce.hpp +76 -0
  42. package/include/opencv2/core/cuda/warp_shuffle.hpp +162 -0
  43. package/include/opencv2/core/cuda.hpp +1279 -0
  44. package/include/opencv2/core/cuda.inl.hpp +763 -0
  45. package/include/opencv2/core/cuda_stream_accessor.hpp +86 -0
  46. package/include/opencv2/core/cuda_types.hpp +144 -0
  47. package/include/opencv2/core/cv_cpu_dispatch.h +381 -0
  48. package/include/opencv2/core/cv_cpu_helper.h +550 -0
  49. package/include/opencv2/core/cvdef.h +973 -0
  50. package/include/opencv2/core/cvstd.hpp +190 -0
  51. package/include/opencv2/core/cvstd.inl.hpp +197 -0
  52. package/include/opencv2/core/cvstd_wrapper.hpp +154 -0
  53. package/include/opencv2/core/detail/async_promise.hpp +71 -0
  54. package/include/opencv2/core/detail/dispatch_helper.impl.hpp +49 -0
  55. package/include/opencv2/core/detail/exception_ptr.hpp +27 -0
  56. package/include/opencv2/core/directx.hpp +184 -0
  57. package/include/opencv2/core/dualquaternion.hpp +979 -0
  58. package/include/opencv2/core/dualquaternion.inl.hpp +487 -0
  59. package/include/opencv2/core/eigen.hpp +402 -0
  60. package/include/opencv2/core/fast_math.hpp +433 -0
  61. package/include/opencv2/core/hal/hal.hpp +256 -0
  62. package/include/opencv2/core/hal/interface.h +190 -0
  63. package/include/opencv2/core/hal/intrin.hpp +939 -0
  64. package/include/opencv2/core/hal/intrin_avx.hpp +3177 -0
  65. package/include/opencv2/core/hal/intrin_avx512.hpp +3090 -0
  66. package/include/opencv2/core/hal/intrin_cpp.hpp +3321 -0
  67. package/include/opencv2/core/hal/intrin_forward.hpp +191 -0
  68. package/include/opencv2/core/hal/intrin_lasx.hpp +3236 -0
  69. package/include/opencv2/core/hal/intrin_msa.hpp +1887 -0
  70. package/include/opencv2/core/hal/intrin_neon.hpp +2610 -0
  71. package/include/opencv2/core/hal/intrin_rvv.hpp +3320 -0
  72. package/include/opencv2/core/hal/intrin_rvv071.hpp +2545 -0
  73. package/include/opencv2/core/hal/intrin_rvv_scalable.hpp +2080 -0
  74. package/include/opencv2/core/hal/intrin_sse.hpp +3467 -0
  75. package/include/opencv2/core/hal/intrin_sse_em.hpp +180 -0
  76. package/include/opencv2/core/hal/intrin_vsx.hpp +1608 -0
  77. package/include/opencv2/core/hal/intrin_wasm.hpp +2782 -0
  78. package/include/opencv2/core/hal/msa_macros.h +1558 -0
  79. package/include/opencv2/core/hal/simd_utils.impl.hpp +186 -0
  80. package/include/opencv2/core/llapi/llapi.h +102 -0
  81. package/include/opencv2/core/mat.hpp +3775 -0
  82. package/include/opencv2/core/mat.inl.hpp +3422 -0
  83. package/include/opencv2/core/matx.hpp +1536 -0
  84. package/include/opencv2/core/neon_utils.hpp +128 -0
  85. package/include/opencv2/core/ocl.hpp +917 -0
  86. package/include/opencv2/core/ocl_genbase.hpp +69 -0
  87. package/include/opencv2/core/opencl/ocl_defs.hpp +82 -0
  88. package/include/opencv2/core/opencl/opencl_info.hpp +212 -0
  89. package/include/opencv2/core/opencl/opencl_svm.hpp +81 -0
  90. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp +602 -0
  91. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp +146 -0
  92. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp +371 -0
  93. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp +272 -0
  94. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp +62 -0
  95. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp +42 -0
  96. package/include/opencv2/core/opencl/runtime/opencl_clblas.hpp +53 -0
  97. package/include/opencv2/core/opencl/runtime/opencl_clfft.hpp +53 -0
  98. package/include/opencv2/core/opencl/runtime/opencl_core.hpp +84 -0
  99. package/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp +47 -0
  100. package/include/opencv2/core/opencl/runtime/opencl_gl.hpp +53 -0
  101. package/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp +47 -0
  102. package/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp +48 -0
  103. package/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp +42 -0
  104. package/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp +166 -0
  105. package/include/opencv2/core/opengl.hpp +733 -0
  106. package/include/opencv2/core/openvx/ovx_defs.hpp +48 -0
  107. package/include/opencv2/core/operations.hpp +610 -0
  108. package/include/opencv2/core/optim.hpp +302 -0
  109. package/include/opencv2/core/ovx.hpp +28 -0
  110. package/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp +72 -0
  111. package/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp +153 -0
  112. package/include/opencv2/core/parallel/parallel_backend.hpp +90 -0
  113. package/include/opencv2/core/persistence.hpp +1350 -0
  114. package/include/opencv2/core/private/cv_cpu_include_simd_declarations.hpp +30 -0
  115. package/include/opencv2/core/private.cuda.hpp +169 -0
  116. package/include/opencv2/core/private.hpp +896 -0
  117. package/include/opencv2/core/quaternion.hpp +1696 -0
  118. package/include/opencv2/core/quaternion.inl.hpp +1063 -0
  119. package/include/opencv2/core/saturate.hpp +180 -0
  120. package/include/opencv2/core/simd_intrinsics.hpp +87 -0
  121. package/include/opencv2/core/softfloat.hpp +514 -0
  122. package/include/opencv2/core/sse_utils.hpp +652 -0
  123. package/include/opencv2/core/traits.hpp +417 -0
  124. package/include/opencv2/core/types.hpp +2457 -0
  125. package/include/opencv2/core/types_c.h +2126 -0
  126. package/include/opencv2/core/utility.hpp +1229 -0
  127. package/include/opencv2/core/utils/allocator_stats.hpp +29 -0
  128. package/include/opencv2/core/utils/allocator_stats.impl.hpp +158 -0
  129. package/include/opencv2/core/utils/buffer_area.private.hpp +136 -0
  130. package/include/opencv2/core/utils/configuration.private.hpp +22 -0
  131. package/include/opencv2/core/utils/filesystem.hpp +82 -0
  132. package/include/opencv2/core/utils/filesystem.private.hpp +66 -0
  133. package/include/opencv2/core/utils/fp_control.private.hpp +29 -0
  134. package/include/opencv2/core/utils/fp_control_utils.hpp +69 -0
  135. package/include/opencv2/core/utils/instrumentation.hpp +125 -0
  136. package/include/opencv2/core/utils/lock.private.hpp +119 -0
  137. package/include/opencv2/core/utils/logger.defines.hpp +42 -0
  138. package/include/opencv2/core/utils/logger.hpp +218 -0
  139. package/include/opencv2/core/utils/logtag.hpp +28 -0
  140. package/include/opencv2/core/utils/plugin_loader.private.hpp +165 -0
  141. package/include/opencv2/core/utils/tls.hpp +235 -0
  142. package/include/opencv2/core/utils/trace.hpp +252 -0
  143. package/include/opencv2/core/utils/trace.private.hpp +421 -0
  144. package/include/opencv2/core/va_intel.hpp +75 -0
  145. package/include/opencv2/core/version.hpp +26 -0
  146. package/include/opencv2/core/vsx_utils.hpp +1047 -0
  147. package/include/opencv2/core.hpp +3365 -0
  148. package/include/opencv2/imgcodecs/imgcodecs.hpp +48 -0
  149. package/include/opencv2/imgcodecs/imgcodecs_c.h +1 -0
  150. package/include/opencv2/imgcodecs/ios.h +59 -0
  151. package/include/opencv2/imgcodecs/legacy/constants_c.h +54 -0
  152. package/include/opencv2/imgcodecs/macosx.h +20 -0
  153. package/include/opencv2/imgcodecs.hpp +407 -0
  154. package/include/opencv2/imgproc/bindings.hpp +34 -0
  155. package/include/opencv2/imgproc/detail/gcgraph.hpp +395 -0
  156. package/include/opencv2/imgproc/hal/hal.hpp +246 -0
  157. package/include/opencv2/imgproc/hal/interface.h +46 -0
  158. package/include/opencv2/imgproc/imgproc.hpp +48 -0
  159. package/include/opencv2/imgproc/imgproc_c.h +1177 -0
  160. package/include/opencv2/imgproc/segmentation.hpp +141 -0
  161. package/include/opencv2/imgproc/types_c.h +659 -0
  162. package/include/opencv2/imgproc.hpp +5035 -0
  163. package/include/opencv2/opencv_modules.hpp +17 -0
  164. package/libs/libjpeg-turbo.lib +0 -0
  165. package/libs/libpng.lib +0 -0
  166. package/libs/opencv_core470.lib +0 -0
  167. package/libs/opencv_imgcodecs470.lib +0 -0
  168. package/libs/opencv_imgproc470.lib +0 -0
  169. package/libs/zlib.lib +0 -0
  170. package/package.json +8 -2
  171. package/prebuilds/win32-x64/node.napi.node +0 -0
  172. package/src/cpp/capturewindow.cpp +36 -46
  173. package/src/cpp/main.cpp +10 -2
  174. package/src/cpp/opencv.cpp +425 -0
@@ -0,0 +1,664 @@
1
+ /*M///////////////////////////////////////////////////////////////////////////////////////
2
+ //
3
+ // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4
+ //
5
+ // By downloading, copying, installing or using the software you agree to this license.
6
+ // If you do not agree to this license, do not download, install,
7
+ // copy or use the software.
8
+ //
9
+ //
10
+ // License Agreement
11
+ // For Open Source Computer Vision Library
12
+ //
13
+ // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14
+ // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15
+ // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16
+ // Copyright (C) 2014, Itseez Inc., all rights reserved.
17
+ // Third party copyrights are property of their respective owners.
18
+ //
19
+ // Redistribution and use in source and binary forms, with or without modification,
20
+ // are permitted provided that the following conditions are met:
21
+ //
22
+ // * Redistribution's of source code must retain the above copyright notice,
23
+ // this list of conditions and the following disclaimer.
24
+ //
25
+ // * Redistribution's in binary form must reproduce the above copyright notice,
26
+ // this list of conditions and the following disclaimer in the documentation
27
+ // and/or other materials provided with the distribution.
28
+ //
29
+ // * The name of the copyright holders may not be used to endorse or promote products
30
+ // derived from this software without specific prior written permission.
31
+ //
32
+ // This software is provided by the copyright holders and contributors "as is" and
33
+ // any express or implied warranties, including, but not limited to, the implied
34
+ // warranties of merchantability and fitness for a particular purpose are disclaimed.
35
+ // In no event shall the Intel Corporation or contributors be liable for any direct,
36
+ // indirect, incidental, special, exemplary, or consequential damages
37
+ // (including, but not limited to, procurement of substitute goods or services;
38
+ // loss of use, data, or profits; or business interruption) however caused
39
+ // and on any theory of liability, whether in contract, strict liability,
40
+ // or tort (including negligence or otherwise) arising in any way out of
41
+ // the use of this software, even if advised of the possibility of such damage.
42
+ //
43
+ //M*/
44
+
45
+ #ifndef OPENCV_CORE_BASE_HPP
46
+ #define OPENCV_CORE_BASE_HPP
47
+
48
+ #ifndef __cplusplus
49
+ # error base.hpp header must be compiled as C++
50
+ #endif
51
+
52
+ #include "opencv2/opencv_modules.hpp"
53
+
54
+ #include <climits>
55
+ #include <algorithm>
56
+
57
+ #include "opencv2/core/cvdef.h"
58
+ #include "opencv2/core/cvstd.hpp"
59
+
60
+ namespace cv
61
+ {
62
+
63
+ //! @addtogroup core_utils
64
+ //! @{
65
+
66
+ namespace Error {
67
+ //! error codes
68
+ enum Code {
69
+ StsOk= 0, //!< everything is ok
70
+ StsBackTrace= -1, //!< pseudo error for back trace
71
+ StsError= -2, //!< unknown /unspecified error
72
+ StsInternal= -3, //!< internal error (bad state)
73
+ StsNoMem= -4, //!< insufficient memory
74
+ StsBadArg= -5, //!< function arg/param is bad
75
+ StsBadFunc= -6, //!< unsupported function
76
+ StsNoConv= -7, //!< iteration didn't converge
77
+ StsAutoTrace= -8, //!< tracing
78
+ HeaderIsNull= -9, //!< image header is NULL
79
+ BadImageSize= -10, //!< image size is invalid
80
+ BadOffset= -11, //!< offset is invalid
81
+ BadDataPtr= -12, //!<
82
+ BadStep= -13, //!< image step is wrong, this may happen for a non-continuous matrix.
83
+ BadModelOrChSeq= -14, //!<
84
+ BadNumChannels= -15, //!< bad number of channels, for example, some functions accept only single channel matrices.
85
+ BadNumChannel1U= -16, //!<
86
+ BadDepth= -17, //!< input image depth is not supported by the function
87
+ BadAlphaChannel= -18, //!<
88
+ BadOrder= -19, //!< number of dimensions is out of range
89
+ BadOrigin= -20, //!< incorrect input origin
90
+ BadAlign= -21, //!< incorrect input align
91
+ BadCallBack= -22, //!<
92
+ BadTileSize= -23, //!<
93
+ BadCOI= -24, //!< input COI is not supported
94
+ BadROISize= -25, //!< incorrect input roi
95
+ MaskIsTiled= -26, //!<
96
+ StsNullPtr= -27, //!< null pointer
97
+ StsVecLengthErr= -28, //!< incorrect vector length
98
+ StsFilterStructContentErr= -29, //!< incorrect filter structure content
99
+ StsKernelStructContentErr= -30, //!< incorrect transform kernel content
100
+ StsFilterOffsetErr= -31, //!< incorrect filter offset value
101
+ StsBadSize= -201, //!< the input/output structure size is incorrect
102
+ StsDivByZero= -202, //!< division by zero
103
+ StsInplaceNotSupported= -203, //!< in-place operation is not supported
104
+ StsObjectNotFound= -204, //!< request can't be completed
105
+ StsUnmatchedFormats= -205, //!< formats of input/output arrays differ
106
+ StsBadFlag= -206, //!< flag is wrong or not supported
107
+ StsBadPoint= -207, //!< bad CvPoint
108
+ StsBadMask= -208, //!< bad format of mask (neither 8uC1 nor 8sC1)
109
+ StsUnmatchedSizes= -209, //!< sizes of input/output structures do not match
110
+ StsUnsupportedFormat= -210, //!< the data format/type is not supported by the function
111
+ StsOutOfRange= -211, //!< some of parameters are out of range
112
+ StsParseError= -212, //!< invalid syntax/structure of the parsed file
113
+ StsNotImplemented= -213, //!< the requested function/feature is not implemented
114
+ StsBadMemBlock= -214, //!< an allocated block has been corrupted
115
+ StsAssert= -215, //!< assertion failed
116
+ GpuNotSupported= -216, //!< no CUDA support
117
+ GpuApiCallError= -217, //!< GPU API call error
118
+ OpenGlNotSupported= -218, //!< no OpenGL support
119
+ OpenGlApiCallError= -219, //!< OpenGL API call error
120
+ OpenCLApiCallError= -220, //!< OpenCL API call error
121
+ OpenCLDoubleNotSupported= -221,
122
+ OpenCLInitError= -222, //!< OpenCL initialization error
123
+ OpenCLNoAMDBlasFft= -223
124
+ };
125
+ } //Error
126
+
127
+ //! @} core_utils
128
+
129
+ //! @addtogroup core_array
130
+ //! @{
131
+
132
+ //! matrix decomposition types
133
+ enum DecompTypes {
134
+ /** Gaussian elimination with the optimal pivot element chosen. */
135
+ DECOMP_LU = 0,
136
+ /** singular value decomposition (SVD) method; the system can be over-defined and/or the matrix
137
+ src1 can be singular */
138
+ DECOMP_SVD = 1,
139
+ /** eigenvalue decomposition; the matrix src1 must be symmetrical */
140
+ DECOMP_EIG = 2,
141
+ /** Cholesky \f$LL^T\f$ factorization; the matrix src1 must be symmetrical and positively
142
+ defined */
143
+ DECOMP_CHOLESKY = 3,
144
+ /** QR factorization; the system can be over-defined and/or the matrix src1 can be singular */
145
+ DECOMP_QR = 4,
146
+ /** while all the previous flags are mutually exclusive, this flag can be used together with
147
+ any of the previous; it means that the normal equations
148
+ \f$\texttt{src1}^T\cdot\texttt{src1}\cdot\texttt{dst}=\texttt{src1}^T\texttt{src2}\f$ are
149
+ solved instead of the original system
150
+ \f$\texttt{src1}\cdot\texttt{dst}=\texttt{src2}\f$ */
151
+ DECOMP_NORMAL = 16
152
+ };
153
+
154
+ /** norm types
155
+
156
+ src1 and src2 denote input arrays.
157
+ */
158
+
159
+ enum NormTypes {
160
+ /**
161
+ \f[
162
+ norm = \forkthree
163
+ {\|\texttt{src1}\|_{L_{\infty}} = \max _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) }
164
+ {\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} = \max _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) }
165
+ {\frac{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} }{\|\texttt{src2}\|_{L_{\infty}} }}{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_INF}\) }
166
+ \f]
167
+ */
168
+ NORM_INF = 1,
169
+ /**
170
+ \f[
171
+ norm = \forkthree
172
+ {\| \texttt{src1} \| _{L_1} = \sum _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\)}
173
+ { \| \texttt{src1} - \texttt{src2} \| _{L_1} = \sum _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\) }
174
+ { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_1} }{\|\texttt{src2}\|_{L_1}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L1}\) }
175
+ \f]*/
176
+ NORM_L1 = 2,
177
+ /**
178
+ \f[
179
+ norm = \forkthree
180
+ { \| \texttt{src1} \| _{L_2} = \sqrt{\sum_I \texttt{src1}(I)^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }
181
+ { \| \texttt{src1} - \texttt{src2} \| _{L_2} = \sqrt{\sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }
182
+ { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) }
183
+ \f]
184
+ */
185
+ NORM_L2 = 4,
186
+ /**
187
+ \f[
188
+ norm = \forkthree
189
+ { \| \texttt{src1} \| _{L_2} ^{2} = \sum_I \texttt{src1}(I)^2} {if \(\texttt{normType} = \texttt{NORM_L2SQR}\)}
190
+ { \| \texttt{src1} - \texttt{src2} \| _{L_2} ^{2} = \sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2 }{if \(\texttt{normType} = \texttt{NORM_L2SQR}\) }
191
+ { \left(\frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}}\right)^2 }{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2SQR}\) }
192
+ \f]
193
+ */
194
+ NORM_L2SQR = 5,
195
+ /**
196
+ In the case of one input array, calculates the Hamming distance of the array from zero,
197
+ In the case of two input arrays, calculates the Hamming distance between the arrays.
198
+ */
199
+ NORM_HAMMING = 6,
200
+ /**
201
+ Similar to NORM_HAMMING, but in the calculation, each two bits of the input sequence will
202
+ be added and treated as a single bit to be used in the same calculation as NORM_HAMMING.
203
+ */
204
+ NORM_HAMMING2 = 7,
205
+ NORM_TYPE_MASK = 7, //!< bit-mask which can be used to separate norm type from norm flags
206
+ NORM_RELATIVE = 8, //!< flag
207
+ NORM_MINMAX = 32 //!< flag
208
+ };
209
+
210
+ //! comparison types
211
+ enum CmpTypes { CMP_EQ = 0, //!< src1 is equal to src2.
212
+ CMP_GT = 1, //!< src1 is greater than src2.
213
+ CMP_GE = 2, //!< src1 is greater than or equal to src2.
214
+ CMP_LT = 3, //!< src1 is less than src2.
215
+ CMP_LE = 4, //!< src1 is less than or equal to src2.
216
+ CMP_NE = 5 //!< src1 is unequal to src2.
217
+ };
218
+
219
+ //! generalized matrix multiplication flags
220
+ enum GemmFlags { GEMM_1_T = 1, //!< transposes src1
221
+ GEMM_2_T = 2, //!< transposes src2
222
+ GEMM_3_T = 4 //!< transposes src3
223
+ };
224
+
225
+ enum DftFlags {
226
+ /** performs an inverse 1D or 2D transform instead of the default forward
227
+ transform. */
228
+ DFT_INVERSE = 1,
229
+ /** scales the result: divide it by the number of array elements. Normally, it is
230
+ combined with DFT_INVERSE. */
231
+ DFT_SCALE = 2,
232
+ /** performs a forward or inverse transform of every individual row of the input
233
+ matrix; this flag enables you to transform multiple vectors simultaneously and can be used to
234
+ decrease the overhead (which is sometimes several times larger than the processing itself) to
235
+ perform 3D and higher-dimensional transformations and so forth.*/
236
+ DFT_ROWS = 4,
237
+ /** performs a forward transformation of 1D or 2D real array; the result,
238
+ though being a complex array, has complex-conjugate symmetry (*CCS*, see the function
239
+ description below for details), and such an array can be packed into a real array of the same
240
+ size as input, which is the fastest option and which is what the function does by default;
241
+ however, you may wish to get a full complex array (for simpler spectrum analysis, and so on) -
242
+ pass the flag to enable the function to produce a full-size complex output array. */
243
+ DFT_COMPLEX_OUTPUT = 16,
244
+ /** performs an inverse transformation of a 1D or 2D complex array; the
245
+ result is normally a complex array of the same size, however, if the input array has
246
+ conjugate-complex symmetry (for example, it is a result of forward transformation with
247
+ DFT_COMPLEX_OUTPUT flag), the output is a real array; while the function itself does not
248
+ check whether the input is symmetrical or not, you can pass the flag and then the function
249
+ will assume the symmetry and produce the real output array (note that when the input is packed
250
+ into a real array and inverse transformation is executed, the function treats the input as a
251
+ packed complex-conjugate symmetrical array, and the output will also be a real array). */
252
+ DFT_REAL_OUTPUT = 32,
253
+ /** specifies that input is complex input. If this flag is set, the input must have 2 channels.
254
+ On the other hand, for backwards compatibility reason, if input has 2 channels, input is
255
+ already considered complex. */
256
+ DFT_COMPLEX_INPUT = 64,
257
+ /** performs an inverse 1D or 2D transform instead of the default forward transform. */
258
+ DCT_INVERSE = DFT_INVERSE,
259
+ /** performs a forward or inverse transform of every individual row of the input
260
+ matrix. This flag enables you to transform multiple vectors simultaneously and can be used to
261
+ decrease the overhead (which is sometimes several times larger than the processing itself) to
262
+ perform 3D and higher-dimensional transforms and so forth.*/
263
+ DCT_ROWS = DFT_ROWS
264
+ };
265
+
266
+ //! Various border types, image boundaries are denoted with `|`
267
+ //! @see borderInterpolate, copyMakeBorder
268
+ enum BorderTypes {
269
+ BORDER_CONSTANT = 0, //!< `iiiiii|abcdefgh|iiiiiii` with some specified `i`
270
+ BORDER_REPLICATE = 1, //!< `aaaaaa|abcdefgh|hhhhhhh`
271
+ BORDER_REFLECT = 2, //!< `fedcba|abcdefgh|hgfedcb`
272
+ BORDER_WRAP = 3, //!< `cdefgh|abcdefgh|abcdefg`
273
+ BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`
274
+ BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno`
275
+
276
+ BORDER_REFLECT101 = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
277
+ BORDER_DEFAULT = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
278
+ BORDER_ISOLATED = 16 //!< do not look outside of ROI
279
+ };
280
+
281
+ //! @} core_array
282
+
283
+ //! @addtogroup core_utils
284
+ //! @{
285
+
286
+ /*! @brief Signals an error and raises the exception.
287
+
288
+ By default the function prints information about the error to stderr,
289
+ then it either stops if setBreakOnError() had been called before or raises the exception.
290
+ It is possible to alternate error processing by using redirectError().
291
+ @param _code - error code (Error::Code)
292
+ @param _err - error description
293
+ @param _func - function name. Available only when the compiler supports getting it
294
+ @param _file - source file name where the error has occurred
295
+ @param _line - line number in the source file where the error has occurred
296
+ @see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert
297
+ */
298
+ CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
299
+
300
+ #ifdef CV_STATIC_ANALYSIS
301
+
302
+ // In practice, some macro are not processed correctly (noreturn is not detected).
303
+ // We need to use simplified definition for them.
304
+ #define CV_Error(code, msg) do { (void)(code); (void)(msg); abort(); } while (0)
305
+ #define CV_Error_(code, args) do { (void)(code); (void)(cv::format args); abort(); } while (0)
306
+ #define CV_Assert( expr ) do { if (!(expr)) abort(); } while (0)
307
+
308
+ #else // CV_STATIC_ANALYSIS
309
+
310
+ /** @brief Call the error handler.
311
+
312
+ Currently, the error handler prints the error code and the error message to the standard
313
+ error stream `stderr`. In the Debug configuration, it then provokes memory access violation, so that
314
+ the execution stack and all the parameters can be analyzed by the debugger. In the Release
315
+ configuration, the exception is thrown.
316
+
317
+ @param code one of Error::Code
318
+ @param msg error message
319
+ */
320
+ #define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
321
+
322
+ /** @brief Call the error handler.
323
+
324
+ This macro can be used to construct an error message on-fly to include some dynamic information,
325
+ for example:
326
+ @code
327
+ // note the extra parentheses around the formatted text message
328
+ CV_Error_(Error::StsOutOfRange,
329
+ ("the value at (%d, %d)=%g is out of range", badPt.x, badPt.y, badValue));
330
+ @endcode
331
+ @param code one of Error::Code
332
+ @param args printf-like formatted error message in parentheses
333
+ */
334
+ #define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
335
+
336
+ /** @brief Checks a condition at runtime and throws exception if it fails
337
+
338
+ The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros
339
+ raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
340
+ configurations while CV_DbgAssert is only retained in the Debug configuration.
341
+ */
342
+ #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
343
+
344
+ #endif // CV_STATIC_ANALYSIS
345
+
346
+ //! @cond IGNORED
347
+ #if !defined(__OPENCV_BUILD) // TODO: backward compatibility only
348
+ #ifndef CV_ErrorNoReturn
349
+ #define CV_ErrorNoReturn CV_Error
350
+ #endif
351
+ #ifndef CV_ErrorNoReturn_
352
+ #define CV_ErrorNoReturn_ CV_Error_
353
+ #endif
354
+ #endif
355
+
356
+ #define CV_Assert_1 CV_Assert
357
+ #define CV_Assert_2( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_1( __VA_ARGS__ ))
358
+ #define CV_Assert_3( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_2( __VA_ARGS__ ))
359
+ #define CV_Assert_4( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_3( __VA_ARGS__ ))
360
+ #define CV_Assert_5( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_4( __VA_ARGS__ ))
361
+ #define CV_Assert_6( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_5( __VA_ARGS__ ))
362
+ #define CV_Assert_7( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_6( __VA_ARGS__ ))
363
+ #define CV_Assert_8( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_7( __VA_ARGS__ ))
364
+ #define CV_Assert_9( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_8( __VA_ARGS__ ))
365
+ #define CV_Assert_10( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_9( __VA_ARGS__ ))
366
+
367
+ #define CV_Assert_N(...) do { __CV_EXPAND(__CV_CAT(CV_Assert_, __CV_VA_NUM_ARGS(__VA_ARGS__)) (__VA_ARGS__)); } while(0)
368
+
369
+ //! @endcond
370
+
371
+ #if defined _DEBUG || defined CV_STATIC_ANALYSIS
372
+ # define CV_DbgAssert(expr) CV_Assert(expr)
373
+ #else
374
+ /** replaced with CV_Assert(expr) in Debug configuration */
375
+ # define CV_DbgAssert(expr)
376
+ #endif
377
+
378
+ /*
379
+ * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor
380
+ * bit count of A exclusive XOR'ed with B
381
+ */
382
+ struct CV_EXPORTS Hamming
383
+ {
384
+ static const NormTypes normType = NORM_HAMMING;
385
+ typedef unsigned char ValueType;
386
+ typedef int ResultType;
387
+
388
+ /** this will count the bits in a ^ b
389
+ */
390
+ ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const;
391
+ };
392
+
393
+ typedef Hamming HammingLUT;
394
+
395
+ /////////////////////////////////// inline norms ////////////////////////////////////
396
+
397
+ template<typename _Tp> inline _Tp cv_abs(_Tp x) { return std::abs(x); }
398
+ inline int cv_abs(uchar x) { return x; }
399
+ inline int cv_abs(schar x) { return std::abs(x); }
400
+ inline int cv_abs(ushort x) { return x; }
401
+ inline int cv_abs(short x) { return std::abs(x); }
402
+
403
+ template<typename _Tp, typename _AccTp> static inline
404
+ _AccTp normL2Sqr(const _Tp* a, int n)
405
+ {
406
+ _AccTp s = 0;
407
+ int i=0;
408
+ #if CV_ENABLE_UNROLLED
409
+ for( ; i <= n - 4; i += 4 )
410
+ {
411
+ _AccTp v0 = a[i], v1 = a[i+1], v2 = a[i+2], v3 = a[i+3];
412
+ s += v0*v0 + v1*v1 + v2*v2 + v3*v3;
413
+ }
414
+ #endif
415
+ for( ; i < n; i++ )
416
+ {
417
+ _AccTp v = a[i];
418
+ s += v*v;
419
+ }
420
+ return s;
421
+ }
422
+
423
+ template<typename _Tp, typename _AccTp> static inline
424
+ _AccTp normL1(const _Tp* a, int n)
425
+ {
426
+ _AccTp s = 0;
427
+ int i = 0;
428
+ #if CV_ENABLE_UNROLLED
429
+ for(; i <= n - 4; i += 4 )
430
+ {
431
+ s += (_AccTp)cv_abs(a[i]) + (_AccTp)cv_abs(a[i+1]) +
432
+ (_AccTp)cv_abs(a[i+2]) + (_AccTp)cv_abs(a[i+3]);
433
+ }
434
+ #endif
435
+ for( ; i < n; i++ )
436
+ s += cv_abs(a[i]);
437
+ return s;
438
+ }
439
+
440
+ template<typename _Tp, typename _AccTp> static inline
441
+ _AccTp normInf(const _Tp* a, int n)
442
+ {
443
+ _AccTp s = 0;
444
+ for( int i = 0; i < n; i++ )
445
+ s = std::max(s, (_AccTp)cv_abs(a[i]));
446
+ return s;
447
+ }
448
+
449
+ template<typename _Tp, typename _AccTp> static inline
450
+ _AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n)
451
+ {
452
+ _AccTp s = 0;
453
+ int i= 0;
454
+ #if CV_ENABLE_UNROLLED
455
+ for(; i <= n - 4; i += 4 )
456
+ {
457
+ _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);
458
+ s += v0*v0 + v1*v1 + v2*v2 + v3*v3;
459
+ }
460
+ #endif
461
+ for( ; i < n; i++ )
462
+ {
463
+ _AccTp v = _AccTp(a[i] - b[i]);
464
+ s += v*v;
465
+ }
466
+ return s;
467
+ }
468
+
469
+ static inline float normL2Sqr(const float* a, const float* b, int n)
470
+ {
471
+ float s = 0.f;
472
+ for( int i = 0; i < n; i++ )
473
+ {
474
+ float v = a[i] - b[i];
475
+ s += v*v;
476
+ }
477
+ return s;
478
+ }
479
+
480
+ template<typename _Tp, typename _AccTp> static inline
481
+ _AccTp normL1(const _Tp* a, const _Tp* b, int n)
482
+ {
483
+ _AccTp s = 0;
484
+ int i= 0;
485
+ #if CV_ENABLE_UNROLLED
486
+ for(; i <= n - 4; i += 4 )
487
+ {
488
+ _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);
489
+ s += std::abs(v0) + std::abs(v1) + std::abs(v2) + std::abs(v3);
490
+ }
491
+ #endif
492
+ for( ; i < n; i++ )
493
+ {
494
+ _AccTp v = _AccTp(a[i] - b[i]);
495
+ s += std::abs(v);
496
+ }
497
+ return s;
498
+ }
499
+
500
+ inline float normL1(const float* a, const float* b, int n)
501
+ {
502
+ float s = 0.f;
503
+ for( int i = 0; i < n; i++ )
504
+ {
505
+ s += std::abs(a[i] - b[i]);
506
+ }
507
+ return s;
508
+ }
509
+
510
+ inline int normL1(const uchar* a, const uchar* b, int n)
511
+ {
512
+ int s = 0;
513
+ for( int i = 0; i < n; i++ )
514
+ {
515
+ s += std::abs(a[i] - b[i]);
516
+ }
517
+ return s;
518
+ }
519
+
520
+ template<typename _Tp, typename _AccTp> static inline
521
+ _AccTp normInf(const _Tp* a, const _Tp* b, int n)
522
+ {
523
+ _AccTp s = 0;
524
+ for( int i = 0; i < n; i++ )
525
+ {
526
+ _AccTp v0 = a[i] - b[i];
527
+ s = std::max(s, std::abs(v0));
528
+ }
529
+ return s;
530
+ }
531
+
532
+ /** @brief Computes the cube root of an argument.
533
+
534
+ The function cubeRoot computes \f$\sqrt[3]{\texttt{val}}\f$. Negative arguments are handled correctly.
535
+ NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for
536
+ single-precision data.
537
+ @param val A function argument.
538
+ */
539
+ CV_EXPORTS_W float cubeRoot(float val);
540
+
541
+ /** @overload
542
+
543
+ cubeRoot with argument of `double` type calls `std::cbrt(double)`
544
+ */
545
+ static inline
546
+ double cubeRoot(double val)
547
+ {
548
+ return std::cbrt(val);
549
+ }
550
+
551
+ /** @brief Calculates the angle of a 2D vector in degrees.
552
+
553
+ The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured
554
+ in degrees and varies from 0 to 360 degrees. The accuracy is about 0.3 degrees.
555
+ @param x x-coordinate of the vector.
556
+ @param y y-coordinate of the vector.
557
+ */
558
+ CV_EXPORTS_W float fastAtan2(float y, float x);
559
+
560
+ /** proxy for hal::LU */
561
+ CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);
562
+ /** proxy for hal::LU */
563
+ CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);
564
+ /** proxy for hal::Cholesky */
565
+ CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);
566
+ /** proxy for hal::Cholesky */
567
+ CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);
568
+
569
+ ////////////////// forward declarations for important OpenCV types //////////////////
570
+
571
+ //! @cond IGNORED
572
+
573
+ template<typename _Tp, int cn> class Vec;
574
+ template<typename _Tp, int m, int n> class Matx;
575
+
576
+ template<typename _Tp> class Complex;
577
+ template<typename _Tp> class Point_;
578
+ template<typename _Tp> class Point3_;
579
+ template<typename _Tp> class Size_;
580
+ template<typename _Tp> class Rect_;
581
+ template<typename _Tp> class Scalar_;
582
+
583
+ class CV_EXPORTS RotatedRect;
584
+ class CV_EXPORTS Range;
585
+ class CV_EXPORTS TermCriteria;
586
+ class CV_EXPORTS KeyPoint;
587
+ class CV_EXPORTS DMatch;
588
+ class CV_EXPORTS RNG;
589
+
590
+ class CV_EXPORTS Mat;
591
+ class CV_EXPORTS MatExpr;
592
+
593
+ class CV_EXPORTS UMat;
594
+
595
+ class CV_EXPORTS SparseMat;
596
+ typedef Mat MatND;
597
+
598
+ template<typename _Tp> class Mat_;
599
+ template<typename _Tp> class SparseMat_;
600
+
601
+ class CV_EXPORTS MatConstIterator;
602
+ class CV_EXPORTS SparseMatIterator;
603
+ class CV_EXPORTS SparseMatConstIterator;
604
+ template<typename _Tp> class MatIterator_;
605
+ template<typename _Tp> class MatConstIterator_;
606
+ template<typename _Tp> class SparseMatIterator_;
607
+ template<typename _Tp> class SparseMatConstIterator_;
608
+
609
+ namespace ogl
610
+ {
611
+ class CV_EXPORTS Buffer;
612
+ class CV_EXPORTS Texture2D;
613
+ class CV_EXPORTS Arrays;
614
+ }
615
+
616
+ namespace cuda
617
+ {
618
+ class CV_EXPORTS GpuMat;
619
+ class CV_EXPORTS HostMem;
620
+ class CV_EXPORTS Stream;
621
+ class CV_EXPORTS Event;
622
+ }
623
+
624
+ namespace cudev
625
+ {
626
+ template <typename _Tp> class GpuMat_;
627
+ }
628
+
629
+ namespace ipp
630
+ {
631
+ CV_EXPORTS unsigned long long getIppFeatures();
632
+ CV_EXPORTS void setIppStatus(int status, const char * const funcname = NULL, const char * const filename = NULL,
633
+ int line = 0);
634
+ CV_EXPORTS int getIppStatus();
635
+ CV_EXPORTS String getIppErrorLocation();
636
+ CV_EXPORTS_W bool useIPP();
637
+ CV_EXPORTS_W void setUseIPP(bool flag);
638
+ CV_EXPORTS_W String getIppVersion();
639
+
640
+ // IPP Not-Exact mode. This function may force use of IPP then both IPP and OpenCV provide proper results
641
+ // but have internal accuracy differences which have too much direct or indirect impact on accuracy tests.
642
+ CV_EXPORTS_W bool useIPP_NotExact();
643
+ CV_EXPORTS_W void setUseIPP_NotExact(bool flag);
644
+ #ifndef DISABLE_OPENCV_3_COMPATIBILITY
645
+ static inline bool useIPP_NE() { return useIPP_NotExact(); }
646
+ static inline void setUseIPP_NE(bool flag) { setUseIPP_NotExact(flag); }
647
+ #endif
648
+
649
+ } // ipp
650
+
651
+ //! @endcond
652
+
653
+ //! @} core_utils
654
+
655
+
656
+
657
+
658
+ } // cv
659
+
660
+ #include "opencv2/core/neon_utils.hpp"
661
+ #include "opencv2/core/vsx_utils.hpp"
662
+ #include "opencv2/core/check.hpp"
663
+
664
+ #endif //OPENCV_CORE_BASE_HPP