NativeMethods_features2d.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System.Diagnostics.Contracts;
  2. using System.Runtime.InteropServices;
  3. #pragma warning disable 1591
  4. #pragma warning disable CA1401 // P/Invokes should not be visible
  5. #pragma warning disable IDE1006 // Naming style
  6. namespace OpenCvSharp.Internal;
  7. static partial class NativeMethods
  8. {
  9. // ReSharper disable InconsistentNaming
  10. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  11. public static extern ExceptionStatus features2d_drawKeypoints(
  12. IntPtr image, KeyPoint[] keypoints, int keypointsLength,
  13. IntPtr outImage, Scalar color, int flags);
  14. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  15. public static extern ExceptionStatus features2d_drawMatches(
  16. IntPtr img1, KeyPoint[] keypoints1, int keypoints1Length,
  17. IntPtr img2, KeyPoint[] keypoints2, int keypoints2Length,
  18. DMatch[] matches1to2, int matches1to2Length, IntPtr outImg,
  19. Scalar matchColor, Scalar singlePointColor,
  20. byte[]? matchesMask, int matchesMaskLength, int flags);
  21. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  22. public static extern ExceptionStatus features2d_drawMatchesKnn(
  23. IntPtr img1, KeyPoint[] keypoints1, int keypoints1Length,
  24. IntPtr img2, KeyPoint[] keypoints2, int keypoints2Length,
  25. IntPtr[] matches1to2, int matches1to2Size1, int[] matches1to2Size2,
  26. IntPtr outImg, Scalar matchColor, Scalar singlePointColor,
  27. IntPtr[]? matchesMask, int matchesMaskSize1, int[]? matchesMaskSize2, int flags);
  28. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  29. public static extern ExceptionStatus features2d_evaluateFeatureDetector(
  30. IntPtr img1, IntPtr img2, IntPtr H1to2,
  31. IntPtr keypoints1, IntPtr keypoints2,
  32. out float repeatability, out int correspCount);
  33. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  34. public static extern ExceptionStatus features2d_computeRecallPrecisionCurve(
  35. IntPtr[] matches1to2, int matches1to2Size1, int[] matches1to2Size2,
  36. IntPtr[] correctMatches1to2Mask, int correctMatches1to2MaskSize1, int[] correctMatches1to2MaskSize2,
  37. IntPtr recallPrecisionCurve);
  38. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  39. public static extern ExceptionStatus features2d_getRecall(
  40. Point2f[] recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision, out float returnValue);
  41. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  42. public static extern ExceptionStatus features2d_getNearestPoint(
  43. Point2f[] recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision, out int returnValue);
  44. #region KeyPointsFilter
  45. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  46. public static extern ExceptionStatus features2d_KeyPointsFilter_runByImageBorder(
  47. IntPtr keypoints, Size imageSize, int borderSize);
  48. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  49. public static extern ExceptionStatus features2d_KeyPointsFilter_runByKeypointSize(
  50. IntPtr keypoints, float minSize, float maxSize);
  51. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  52. public static extern ExceptionStatus features2d_KeyPointsFilter_runByPixelsMask(
  53. IntPtr keypoints, IntPtr mask);
  54. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  55. public static extern ExceptionStatus features2d_KeyPointsFilter_removeDuplicated(
  56. IntPtr keypoints);
  57. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  58. public static extern ExceptionStatus features2d_KeyPointsFilter_removeDuplicatedSorted(
  59. IntPtr keypoints);
  60. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  61. public static extern ExceptionStatus features2d_KeyPointsFilter_retainBest(
  62. IntPtr keypoints, int nPoints);
  63. #endregion
  64. }