NativeMethods_imgproc.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. using System.Runtime.InteropServices;
  2. using System.Diagnostics.Contracts;
  3. // ReSharper disable IdentifierTypo
  4. #pragma warning disable 1591
  5. #pragma warning disable CA1401 // P/Invokes should not be visible
  6. #pragma warning disable CA2101 // Specify marshaling for P/Invoke string arguments
  7. #pragma warning disable IDE1006 // Naming rules
  8. namespace OpenCvSharp.Internal;
  9. static partial class NativeMethods
  10. {
  11. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  12. public static extern ExceptionStatus imgproc_getGaussianKernel(
  13. int ksize, double sigma, MatType ktype, out IntPtr returnValue);
  14. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  15. public static extern ExceptionStatus imgproc_getDerivKernels(
  16. IntPtr kx, IntPtr ky, int dx, int dy, int ksize, int normalize, MatType ktype);
  17. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  18. public static extern ExceptionStatus imgproc_getGaborKernel(Size ksize, double sigma, double theta, double lambd,
  19. double gamma, double psi, int ktype, out IntPtr returnValue);
  20. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  21. public static extern ExceptionStatus imgproc_getStructuringElement(int shape, Size ksize, Point anchor, out IntPtr returnValue);
  22. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  23. public static extern ExceptionStatus imgproc_medianBlur(IntPtr src, IntPtr dst, int ksize);
  24. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  25. public static extern ExceptionStatus imgproc_GaussianBlur(IntPtr src, IntPtr dst, Size ksize, double sigmaX,
  26. double sigmaY, BorderTypes borderType);
  27. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  28. public static extern ExceptionStatus imgproc_bilateralFilter(IntPtr src, IntPtr dst, int d, double sigmaColor,
  29. double sigmaSpace, BorderTypes borderType);
  30. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  31. public static extern ExceptionStatus imgproc_boxFilter(IntPtr src, IntPtr dst, MatType ddepth, Size ksize, Point anchor,
  32. int normalize, BorderTypes borderType);
  33. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  34. public static extern ExceptionStatus imgproc_sqrBoxFilter(IntPtr src, IntPtr dst, MatType ddepth, Size ksize, Point anchor,
  35. int normalize, BorderTypes borderType);
  36. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  37. public static extern ExceptionStatus imgproc_blur(IntPtr src, IntPtr dst, Size ksize, Point anchor, int borderType);
  38. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  39. public static extern ExceptionStatus imgproc_filter2D(IntPtr src, IntPtr dst, MatType ddepth, IntPtr kernel, Point anchor,
  40. double delta, int borderType);
  41. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  42. public static extern ExceptionStatus imgproc_sepFilter2D(IntPtr src, IntPtr dst, MatType ddepth, IntPtr kernelX,
  43. IntPtr kernelY, Point anchor, double delta, int borderType);
  44. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  45. public static extern ExceptionStatus imgproc_Sobel(IntPtr src, IntPtr dst, MatType ddepth,
  46. int dx, int dy, int ksize, double scale, double delta, int borderType);
  47. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  48. public static extern ExceptionStatus imgproc_spatialGradient(
  49. IntPtr src, IntPtr dx, IntPtr dy, int ksize, int borderType);
  50. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  51. public static extern ExceptionStatus imgproc_Scharr(IntPtr src, IntPtr dst, MatType ddepth,
  52. int dx, int dy, double scale, double delta, int borderType);
  53. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  54. public static extern ExceptionStatus imgproc_Laplacian(IntPtr src, IntPtr dst, MatType ddepth,
  55. int ksize, double scale, double delta, int borderType);
  56. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  57. public static extern ExceptionStatus imgproc_Canny1(
  58. IntPtr src, IntPtr edges, double threshold1, double threshold2, int apertureSize, int l2Gradient);
  59. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  60. public static extern ExceptionStatus imgproc_Canny2(
  61. IntPtr dx, IntPtr dy, IntPtr edges, double threshold1, double threshold2, int l2Gradient);
  62. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  63. public static extern ExceptionStatus imgproc_cornerMinEigenVal(IntPtr src, IntPtr dst, int blockSize, int ksize,
  64. int borderType);
  65. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  66. public static extern ExceptionStatus imgproc_cornerHarris(IntPtr src, IntPtr dst, int blockSize, int ksize,
  67. double k, int borderType);
  68. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  69. public static extern ExceptionStatus imgproc_cornerEigenValsAndVecs(IntPtr src, IntPtr dst, int blockSize, int ksize,
  70. int borderType);
  71. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  72. public static extern ExceptionStatus imgproc_preCornerDetect(IntPtr src, IntPtr dst, int ksize, int borderType);
  73. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  74. public static extern ExceptionStatus imgproc_cornerSubPix(IntPtr image, IntPtr corners,
  75. Size winSize, Size zeroZone, TermCriteria criteria);
  76. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  77. public static extern ExceptionStatus imgproc_goodFeaturesToTrack(IntPtr src, IntPtr corners,
  78. int maxCorners, double qualityLevel, double minDistance, IntPtr mask, int blockSize, int useHarrisDetector,
  79. double k);
  80. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  81. public static extern ExceptionStatus imgproc_HoughLines(IntPtr src, IntPtr lines,
  82. double rho, double theta, int threshold, double srn, double stn);
  83. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  84. public static extern ExceptionStatus imgproc_HoughLinesP(IntPtr src, IntPtr lines,
  85. double rho, double theta, int threshold, double minLineLength, double maxLineG);
  86. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  87. public static extern ExceptionStatus imgproc_HoughLinesPointSet(
  88. IntPtr point, IntPtr lines, int linesMax, int threshold,
  89. double minRho, double maxRho, double rhoStep,
  90. double minTheta, double maxTheta, double thetaStep);
  91. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  92. public static extern ExceptionStatus imgproc_HoughCircles(IntPtr src, IntPtr circles,
  93. int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius);
  94. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  95. public static extern ExceptionStatus imgproc_erode(IntPtr src, IntPtr dst, IntPtr kernel, Point anchor, int iterations,
  96. int borderType, Scalar borderValue);
  97. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  98. public static extern ExceptionStatus imgproc_dilate(IntPtr src, IntPtr dst, IntPtr kernel, Point anchor, int iterations,
  99. int borderType, Scalar borderValue);
  100. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  101. public static extern ExceptionStatus imgproc_morphologyEx(IntPtr src, IntPtr dst, int op, IntPtr kernel, Point anchor,
  102. int iterations, int borderType, Scalar borderValue);
  103. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  104. public static extern ExceptionStatus imgproc_resize(IntPtr src, IntPtr dst, Size dsize, double fx, double fy,
  105. int interpolation);
  106. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  107. public static extern ExceptionStatus imgproc_warpAffine(IntPtr src, IntPtr dst, IntPtr m, Size dsize, int flags,
  108. int borderMode, Scalar borderValue);
  109. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  110. public static extern ExceptionStatus imgproc_warpPerspective_MisInputArray(
  111. IntPtr src, IntPtr dst, IntPtr m, Size dsize, int flags, int borderMode, Scalar borderValue);
  112. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  113. public static extern ExceptionStatus imgproc_warpPerspective_MisArray(
  114. IntPtr src, IntPtr dst, [MarshalAs(UnmanagedType.LPArray)] float[,] m, int mRow, int mCol,
  115. Size dsize, int flags, int borderMode, Scalar borderValue);
  116. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  117. public static extern ExceptionStatus imgproc_remap(IntPtr src, IntPtr dst, IntPtr map1, IntPtr map2, int interpolation,
  118. int borderMode, Scalar borderValue);
  119. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  120. public static extern ExceptionStatus imgproc_convertMaps(IntPtr map1, IntPtr map2, IntPtr dstmap1, IntPtr dstmap2,
  121. MatType dstmap1Type, int nninterpolation);
  122. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  123. public static extern ExceptionStatus imgproc_getRotationMatrix2D(Point2f center, double angle, double scale, out IntPtr returnValue);
  124. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  125. public static extern ExceptionStatus imgproc_invertAffineTransform(IntPtr m, IntPtr im);
  126. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  127. public static extern ExceptionStatus imgproc_getPerspectiveTransform1(Point2f[] src, Point2f[] dst, out IntPtr returnValue);
  128. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  129. public static extern ExceptionStatus imgproc_getPerspectiveTransform2(IntPtr src, IntPtr dst, out IntPtr returnValue);
  130. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  131. public static extern ExceptionStatus imgproc_getAffineTransform1(Point2f[] src, Point2f[] dst, out IntPtr returnValue);
  132. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  133. public static extern ExceptionStatus imgproc_getAffineTransform2(IntPtr src, IntPtr dst, out IntPtr returnValue);
  134. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  135. public static extern ExceptionStatus imgproc_getRectSubPix(IntPtr image, Size patchSize, Point2f center, IntPtr patch,
  136. int patchType);
  137. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  138. public static extern ExceptionStatus imgproc_logPolar(
  139. IntPtr src, IntPtr dst, Point2f center, double m, int flags);
  140. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  141. public static extern ExceptionStatus imgproc_linearPolar(
  142. IntPtr src, IntPtr dst, Point2f center, double maxRadius, int flags);
  143. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  144. public static extern ExceptionStatus imgproc_warpPolar(
  145. IntPtr src, IntPtr dst, Size dsize, Point2f center, double maxRadius, int flags);
  146. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  147. public static extern ExceptionStatus imgproc_integral1(IntPtr src, IntPtr sum, int sdepth);
  148. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  149. public static extern ExceptionStatus imgproc_integral2(IntPtr src, IntPtr sum, IntPtr sqsum, int sdepth);
  150. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  151. public static extern ExceptionStatus imgproc_integral3(IntPtr src, IntPtr sum, IntPtr sqsum, IntPtr tilted, int sdepth, int sqdepth);
  152. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  153. public static extern ExceptionStatus imgproc_accumulate(IntPtr src, IntPtr dst, IntPtr mask);
  154. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  155. public static extern ExceptionStatus imgproc_accumulateSquare(IntPtr src, IntPtr dst, IntPtr mask);
  156. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  157. public static extern ExceptionStatus imgproc_accumulateProduct(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask);
  158. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  159. public static extern ExceptionStatus imgproc_accumulateWeighted(IntPtr src, IntPtr dst, double alpha, IntPtr mask);
  160. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  161. public static extern ExceptionStatus imgproc_phaseCorrelate(IntPtr src1, IntPtr src2, IntPtr window,
  162. out double response, out Point2d returnValue);
  163. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  164. public static extern ExceptionStatus imgproc_createHanningWindow(IntPtr dst, Size winSize, MatType type);
  165. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  166. public static extern ExceptionStatus imgproc_threshold(IntPtr src, IntPtr dst, double thresh, double maxval, int type, out double returnValue);
  167. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  168. public static extern ExceptionStatus imgproc_adaptiveThreshold(IntPtr src, IntPtr dst,
  169. double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double c);
  170. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  171. public static extern ExceptionStatus imgproc_pyrDown(IntPtr src, IntPtr dst, Size dstsize, int borderType);
  172. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  173. public static extern ExceptionStatus imgproc_buildPyramid(IntPtr src, IntPtr dst, int maxlevel, int borderType);
  174. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  175. public static extern ExceptionStatus imgproc_pyrUp(IntPtr src, IntPtr dst, Size dstsize, int borderType);
  176. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  177. public static extern ExceptionStatus imgproc_calcHist(IntPtr[] images, int nimages,
  178. int[] channels, IntPtr mask, IntPtr hist, int dims, int[] histSize,
  179. IntPtr[] ranges, int uniform, int accumulate);
  180. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  181. public static extern ExceptionStatus imgproc_calcBackProject(IntPtr[] images, int nimages,
  182. int[] channels, IntPtr hist, IntPtr backProject, IntPtr[] ranges, int uniform);
  183. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  184. public static extern ExceptionStatus imgproc_compareHist(IntPtr h1, IntPtr h2, int method, out double returnValue);
  185. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  186. public static extern ExceptionStatus imgproc_equalizeHist(IntPtr src, IntPtr dst);
  187. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  188. public static extern ExceptionStatus imgproc_EMD(IntPtr signature1, IntPtr signature2,
  189. int distType, IntPtr cost, out float lowerBound, IntPtr flow, out float returnValue);
  190. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  191. public static extern ExceptionStatus imgproc_watershed(IntPtr image, IntPtr markers);
  192. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  193. public static extern ExceptionStatus imgproc_pyrMeanShiftFiltering(IntPtr src, IntPtr dst,
  194. double sp, double sr, int maxLevel, TermCriteria termcrit);
  195. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  196. public static extern ExceptionStatus imgproc_grabCut(IntPtr img, IntPtr mask, Rect rect,
  197. IntPtr bgdModel, IntPtr fgdModel,
  198. int iterCount, int mode);
  199. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  200. public static extern ExceptionStatus imgproc_distanceTransformWithLabels(IntPtr src, IntPtr dst, IntPtr labels,
  201. int distanceType, int maskSize, int labelType);
  202. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  203. public static extern ExceptionStatus imgproc_distanceTransform(IntPtr src, IntPtr dst,
  204. int distanceType, int maskSize, int dstType);
  205. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  206. public static extern ExceptionStatus imgproc_floodFill1(IntPtr image,
  207. Point seedPoint, Scalar newVal, out Rect rect,
  208. Scalar loDiff, Scalar upDiff, int flags, out int returnValue);
  209. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  210. public static extern ExceptionStatus imgproc_floodFill2(IntPtr image, IntPtr mask,
  211. Point seedPoint, Scalar newVal, out Rect rect,
  212. Scalar loDiff, Scalar upDiff, int flags, out int returnValue);
  213. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  214. public static extern ExceptionStatus imgproc_blendLinear(
  215. IntPtr src1, IntPtr src2, IntPtr weights1, IntPtr weights2, IntPtr dst);
  216. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  217. public static extern ExceptionStatus imgproc_cvtColor(IntPtr src, IntPtr dst, int code, int dstCn);
  218. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  219. public static extern ExceptionStatus imgproc_cvtColorTwoPlane(IntPtr src1, IntPtr src2, IntPtr dst, int code);
  220. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  221. public static extern ExceptionStatus imgproc_demosaicing(IntPtr src, IntPtr dst, int code, int dstCn);
  222. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  223. public static extern ExceptionStatus imgproc_moments(IntPtr arr, int binaryImage, out Moments.NativeStruct returnValue);
  224. //[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  225. //public static extern ExceptionStatus imgproc_HuMoments(ref Moments.NativeStruct moments, [MarshalAs(UnmanagedType.LPArray)] double[] hu);
  226. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  227. public static extern ExceptionStatus imgproc_matchTemplate(
  228. IntPtr image, IntPtr templ, IntPtr result, int method, IntPtr mask);
  229. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  230. public static extern ExceptionStatus imgproc_connectedComponentsWithAlgorithm(
  231. IntPtr image, IntPtr labels, int connectivity, MatType ltype, int ccltype, out int returnValue);
  232. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  233. public static extern ExceptionStatus imgproc_connectedComponents(
  234. IntPtr image, IntPtr labels, int connectivity, MatType ltype, out int returnValue);
  235. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  236. public static extern ExceptionStatus imgproc_connectedComponentsWithStatsWithAlgorithm(
  237. IntPtr image, IntPtr labels, IntPtr stats, IntPtr centroids, int connectivity, MatType ltype, int ccltype, out int returnValue);
  238. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  239. public static extern ExceptionStatus imgproc_connectedComponentsWithStats(
  240. IntPtr image, IntPtr labels, IntPtr stats, IntPtr centroids, int connectivity, MatType ltype, out int returnValue);
  241. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  242. public static extern ExceptionStatus imgproc_findContours1_vector(IntPtr image, IntPtr contours,
  243. IntPtr hierarchy, int mode, int method, Point offset);
  244. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  245. public static extern ExceptionStatus imgproc_findContours1_OutputArray(IntPtr image, IntPtr contours,
  246. IntPtr hierarchy, int mode, int method, Point offset);
  247. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  248. public static extern ExceptionStatus imgproc_findContours2_vector(IntPtr image, IntPtr contours,
  249. int mode, int method, Point offset);
  250. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  251. public static extern ExceptionStatus imgproc_findContours2_OutputArray(IntPtr image, IntPtr contours,
  252. int mode, int method, Point offset);
  253. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  254. public static extern ExceptionStatus imgproc_approxPolyDP_InputArray(IntPtr curve, IntPtr approxCurve,
  255. double epsilon, int closed);
  256. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  257. public static extern ExceptionStatus imgproc_approxPolyDP_Point(Point[] curve, int curveLength,
  258. IntPtr approxCurve, double epsilon, int closed);
  259. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  260. public static extern ExceptionStatus imgproc_approxPolyDP_Point2f(Point2f[] curve, int curveLength,
  261. IntPtr approxCurve, double epsilon, int closed);
  262. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  263. public static extern ExceptionStatus imgproc_arcLength_InputArray(IntPtr curve, int closed, out double returnValue);
  264. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  265. public static extern ExceptionStatus imgproc_arcLength_Point(Point[] curve, int curveLength, int closed, out double returnValue);
  266. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  267. public static extern ExceptionStatus imgproc_arcLength_Point2f(Point2f[] curve, int curveLength, int closed, out double returnValue);
  268. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  269. public static extern ExceptionStatus imgproc_boundingRect_InputArray(IntPtr curve, out Rect returnValue);
  270. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  271. public static extern ExceptionStatus imgproc_boundingRect_Point(Point[] curve, int curveLength, out Rect returnValue);
  272. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  273. public static extern ExceptionStatus imgproc_boundingRect_Point2f(Point2f[] curve, int curveLength, out Rect returnValue);
  274. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  275. public static extern ExceptionStatus imgproc_contourArea_InputArray(IntPtr contour, int oriented, out double returnValue);
  276. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  277. public static extern ExceptionStatus imgproc_contourArea_Point(
  278. [MarshalAs(UnmanagedType.LPArray)] Point[] contour, int contourLength, int oriented, out double returnValue);
  279. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  280. public static extern ExceptionStatus imgproc_contourArea_Point2f(
  281. [MarshalAs(UnmanagedType.LPArray)] Point2f[] contour, int contourLength, int oriented, out double returnValue);
  282. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  283. public static extern ExceptionStatus imgproc_minAreaRect_InputArray(IntPtr points, out RotatedRect returnValue);
  284. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  285. public static extern ExceptionStatus imgproc_minAreaRect_Point(
  286. [MarshalAs(UnmanagedType.LPArray)] Point[] points, int pointsLength, out RotatedRect returnValue);
  287. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  288. public static extern ExceptionStatus imgproc_minAreaRect_Point2f(
  289. [MarshalAs(UnmanagedType.LPArray)] Point2f[] points, int pointsLength, out RotatedRect returnValue);
  290. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  291. public static extern ExceptionStatus imgproc_boxPoints_OutputArray(RotatedRect box, IntPtr points);
  292. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  293. public static extern ExceptionStatus imgproc_boxPoints_Point2f(RotatedRect box, [MarshalAs(UnmanagedType.LPArray), Out] Point2f[] points);
  294. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  295. public static extern ExceptionStatus imgproc_minEnclosingCircle_InputArray(IntPtr points, out Point2f center,
  296. out float radius);
  297. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  298. public static extern ExceptionStatus imgproc_minEnclosingCircle_Point(Point[] points, int pointsLength,
  299. out Point2f center, out float radius);
  300. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  301. public static extern ExceptionStatus imgproc_minEnclosingCircle_Point2f(Point2f[] points, int pointsLength,
  302. out Point2f center, out float radius);
  303. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  304. public static extern ExceptionStatus imgproc_minEnclosingTriangle_InputOutputArray(IntPtr points, IntPtr triangle, out double returnValue);
  305. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  306. public static extern ExceptionStatus imgproc_minEnclosingTriangle_Point(
  307. [MarshalAs(UnmanagedType.LPArray), In] Point[] points, int pointsLength, IntPtr triangle, out double returnValue);
  308. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  309. public static extern ExceptionStatus imgproc_minEnclosingTriangle_Point2f(
  310. [MarshalAs(UnmanagedType.LPArray), In] Point2f[] points, int pointsLength, IntPtr triangle, out double returnValue);
  311. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  312. public static extern ExceptionStatus imgproc_matchShapes_InputArray(
  313. IntPtr contour1, IntPtr contour2, int method, double parameter, out double returnValue);
  314. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  315. public static extern ExceptionStatus imgproc_matchShapes_Point(
  316. Point[] contour1, int contour1Length, Point[] contour2, int contour2Length, int method, double parameter, out double returnValue);
  317. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  318. public static extern ExceptionStatus imgproc_convexHull_InputArray(IntPtr points, IntPtr hull,
  319. int clockwise, int returnPoints);
  320. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  321. public static extern ExceptionStatus imgproc_convexHull_Point_ReturnsPoints(Point[] points, int pointsLength,
  322. IntPtr hull, int clockwise);
  323. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  324. public static extern ExceptionStatus imgproc_convexHull_Point2f_ReturnsPoints(Point2f[] points, int pointsLength,
  325. IntPtr hull, int clockwise);
  326. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  327. public static extern ExceptionStatus imgproc_convexHull_Point_ReturnsIndices(Point[] points, int pointsLength,
  328. IntPtr hull, int clockwise);
  329. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  330. public static extern ExceptionStatus imgproc_convexHull_Point2f_ReturnsIndices(Point2f[] points, int pointsLength,
  331. IntPtr hull, int clockwise);
  332. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  333. public static extern ExceptionStatus imgproc_convexityDefects_InputArray(IntPtr contour, IntPtr convexHull,
  334. IntPtr convexityDefects);
  335. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  336. public static extern ExceptionStatus imgproc_convexityDefects_Point(Point[] contour, int contourLength, int[] convexHull,
  337. int convexHullLength, IntPtr convexityDefects);
  338. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  339. public static extern ExceptionStatus imgproc_convexityDefects_Point2f(Point2f[] contour, int contourLength,
  340. int[] convexHull, int convexHullLength, IntPtr convexityDefects);
  341. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  342. public static extern ExceptionStatus imgproc_isContourConvex_InputArray(IntPtr contour, out int returnValue);
  343. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  344. public static extern ExceptionStatus imgproc_isContourConvex_Point(Point[] contour, int contourLength, out int returnValue);
  345. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  346. public static extern ExceptionStatus imgproc_isContourConvex_Point2f(Point2f[] contour, int contourLength, out int returnValue);
  347. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  348. public static extern ExceptionStatus imgproc_intersectConvexConvex_InputArray(IntPtr p1, IntPtr p2,
  349. IntPtr p12, int handleNested, out float returnValue);
  350. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  351. public static extern ExceptionStatus imgproc_intersectConvexConvex_Point(Point[] p1, int p1Length, Point[] p2,
  352. int p2Length, IntPtr p12, int handleNested, out float returnValue);
  353. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  354. public static extern ExceptionStatus imgproc_intersectConvexConvex_Point2f(Point2f[] p1, int p1Length, Point2f[] p2,
  355. int p2Length, IntPtr p12, int handleNested, out float returnValue);
  356. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  357. public static extern ExceptionStatus imgproc_fitEllipse_InputArray(IntPtr points, out RotatedRect returnValue);
  358. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  359. public static extern ExceptionStatus imgproc_fitEllipse_Point(Point[] points, int pointsLength, out RotatedRect returnValue);
  360. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  361. public static extern ExceptionStatus imgproc_fitEllipse_Point2f(Point2f[] points, int pointsLength, out RotatedRect returnValue);
  362. // Not exported
  363. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  364. public static extern ExceptionStatus imgproc_fitEllipseAMS_InputArray(IntPtr points, out RotatedRect returnValue);
  365. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  366. public static extern ExceptionStatus imgproc_fitEllipseAMS_Point(Point[] points, int pointsLength, out RotatedRect returnValue);
  367. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  368. public static extern ExceptionStatus imgproc_fitEllipseAMS_Point2f(Point2f[] points, int pointsLength, out RotatedRect returnValue);
  369. // Not exported
  370. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  371. public static extern ExceptionStatus imgproc_fitEllipseDirect_InputArray(IntPtr points, out RotatedRect returnValue);
  372. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  373. public static extern ExceptionStatus imgproc_fitEllipseDirect_Point(Point[] points, int pointsLength, out RotatedRect returnValue);
  374. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  375. public static extern ExceptionStatus imgproc_fitEllipseDirect_Point2f(Point2f[] points, int pointsLength, out RotatedRect returnValue);
  376. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  377. public static extern ExceptionStatus imgproc_fitLine_InputArray(IntPtr points, IntPtr line,
  378. int distType, double param, double reps, double aeps);
  379. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  380. public static extern ExceptionStatus imgproc_fitLine_Point(Point[] points, int pointsLength, [In, Out] float[] line,
  381. int distType,
  382. double param, double reps, double aeps);
  383. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  384. public static extern ExceptionStatus imgproc_fitLine_Point2f(Point2f[] points, int pointsLength, [In, Out] float[] line,
  385. int distType, double param, double reps, double aeps);
  386. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  387. public static extern ExceptionStatus imgproc_fitLine_Point3i(Point3i[] points, int pointsLength, [In, Out] float[] line,
  388. int distType, double param, double reps, double aeps);
  389. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  390. public static extern ExceptionStatus imgproc_fitLine_Point3f(Point3f[] points, int pointsLength, [In, Out] float[] line,
  391. int distType, double param, double reps, double aeps);
  392. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  393. public static extern ExceptionStatus imgproc_pointPolygonTest_InputArray(
  394. IntPtr contour, Point2f pt, int measureDist, out double returnValue);
  395. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  396. public static extern ExceptionStatus imgproc_pointPolygonTest_Point(Point[] contour, int contourLength, Point2f pt,
  397. int measureDist, out double returnValue);
  398. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  399. public static extern ExceptionStatus imgproc_pointPolygonTest_Point2f(Point2f[] contour, int contourLength,
  400. Point2f pt, int measureDist, out double returnValue);
  401. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  402. public static extern ExceptionStatus imgproc_rotatedRectangleIntersection_OutputArray(
  403. RotatedRect rect1, RotatedRect rect2, IntPtr intersectingRegion, out int returnValue);
  404. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  405. public static extern ExceptionStatus imgproc_rotatedRectangleIntersection_vector(
  406. RotatedRect rect1, RotatedRect rect2, IntPtr intersectingRegion, out int returnValue);
  407. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  408. public static extern ExceptionStatus imgproc_applyColorMap1(IntPtr src, IntPtr dst, int colormap);
  409. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  410. public static extern ExceptionStatus imgproc_applyColorMap2(IntPtr src, IntPtr dst, IntPtr userColor);
  411. #region Drawing
  412. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  413. public static extern ExceptionStatus imgproc_line(
  414. IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift);
  415. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  416. public static extern ExceptionStatus imgproc_arrowedLine(
  417. IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift, double tipLength);
  418. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  419. public static extern ExceptionStatus imgproc_rectangle_InputOutputArray_Point(
  420. IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift);
  421. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  422. public static extern ExceptionStatus imgproc_rectangle_InputOutputArray_Rect(
  423. IntPtr img, Rect rect, Scalar color, int thickness, int lineType, int shift);
  424. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  425. public static extern ExceptionStatus imgproc_rectangle_Mat_Point(
  426. IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift);
  427. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  428. public static extern ExceptionStatus imgproc_rectangle_Mat_Rect(
  429. IntPtr img, Rect rect, Scalar color, int thickness, int lineType, int shift);
  430. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  431. public static extern ExceptionStatus imgproc_circle(IntPtr img, Point center, int radius, Scalar color, int thickness,
  432. int lineType, int shift);
  433. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  434. public static extern ExceptionStatus imgproc_ellipse1(
  435. IntPtr img, Point center, Size axes,
  436. double angle, double startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift);
  437. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  438. public static extern ExceptionStatus imgproc_ellipse2(
  439. IntPtr img, RotatedRect box, Scalar color, int thickness, int lineType);
  440. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  441. public static extern ExceptionStatus imgproc_drawMarker(
  442. IntPtr img, Point position, Scalar color, int markerType, int markerSize, int thickness, int lineType);
  443. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  444. public static extern ExceptionStatus imgproc_fillConvexPoly_Mat(
  445. IntPtr img, Point[] pts, int npts, Scalar color, int lineType, int shift);
  446. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  447. public static extern ExceptionStatus imgproc_fillConvexPoly_InputOutputArray(
  448. IntPtr img, IntPtr points, Scalar color, int lineType, int shift);
  449. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  450. public static extern ExceptionStatus imgproc_fillPoly_Mat(
  451. IntPtr img, IntPtr[] pts, int[] npts, int ncontours,
  452. Scalar color, int lineType, int shift, Point offset);
  453. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  454. public static extern ExceptionStatus imgproc_fillPoly_InputOutputArray(
  455. IntPtr img, IntPtr pts, Scalar color, int lineType, int shift, Point offset);
  456. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  457. public static extern ExceptionStatus imgproc_polylines_Mat(
  458. IntPtr img, IntPtr[] pts, int[] npts,
  459. int ncontours, int isClosed, Scalar color, int thickness, int lineType, int shift);
  460. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  461. public static extern ExceptionStatus imgproc_polylines_InputOutputArray(
  462. IntPtr img, IntPtr pts, int isClosed, Scalar color, int thickness, int lineType, int shift);
  463. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  464. public static extern ExceptionStatus imgproc_drawContours_vector(IntPtr image,
  465. IntPtr[] contours, int contoursSize1, int[] contoursSize2,
  466. int contourIdx, Scalar color, int thickness, int lineType,
  467. Vec4i[] hierarchy, int hiearchyLength, int maxLevel, Point offset);
  468. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  469. public static extern ExceptionStatus imgproc_drawContours_vector(IntPtr image,
  470. IntPtr[] contours, int contoursSize1, int[] contoursSize2,
  471. int contourIdx, Scalar color, int thickness, int lineType,
  472. IntPtr hierarchy, int hiearchyLength, int maxLevel, Point offset);
  473. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  474. public static extern ExceptionStatus imgproc_drawContours_InputArray(IntPtr image,
  475. IntPtr[] contours, int contoursLength,
  476. int contourIdx, Scalar color, int thickness, int lineType,
  477. IntPtr hierarchy, int maxLevel, Point offset);
  478. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  479. public static extern ExceptionStatus imgproc_clipLine1(Size imgSize, ref Point pt1, ref Point pt2, out int returnValue);
  480. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  481. public static extern ExceptionStatus imgproc_clipLine2(Rect imgRect, ref Point pt1, ref Point pt2, out int returnValue);
  482. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  483. public static extern ExceptionStatus imgproc_ellipse2Poly_int(
  484. Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, IntPtr pts);
  485. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  486. public static extern ExceptionStatus imgproc_ellipse2Poly_double(
  487. Point2d center, Size2d axes, int angle, int arcStart, int arcEnd, int delta, IntPtr pts);
  488. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  489. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  490. public static extern ExceptionStatus imgproc_putText(IntPtr img, [MarshalAs(UnmanagedType.LPStr)] string text, Point org,
  491. int fontFace, double fontScale, Scalar color,
  492. int thickness, int lineType, int bottomLeftOrigin);
  493. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  494. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  495. public static extern ExceptionStatus imgproc_getTextSize([MarshalAs(UnmanagedType.LPStr)] string text, int fontFace,
  496. double fontScale, int thickness, out int baseLine, out Size returnValue);
  497. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  498. public static extern ExceptionStatus imgproc_getFontScaleFromHeight(
  499. int fontFace, int pixelHeight, int thickness, out double returnValue);
  500. #endregion
  501. }