@@ -21,14 +21,10 @@ static partial class Cv2
2121 /// <returns>keypoints detected on the image.</returns>
2222 public static KeyPoint [ ] FAST ( InputArray image , int threshold , bool nonmaxSupression = true )
2323 {
24- if ( image is null )
25- throw new ArgumentNullException ( nameof ( image ) ) ;
26- image . ThrowIfDisposed ( ) ;
27-
2824 using var kp = new StdVector < KeyPoint > ( ) ;
2925 NativeMethods . HandleException (
30- NativeMethods . features_FAST1 ( image . ToInputProxy ( ) , kp . CvPtr , threshold , nonmaxSupression ? 1 : 0 ) ) ;
31- GC . KeepAlive ( image ) ;
26+ NativeMethods . features_FAST1 ( image . Proxy , kp . CvPtr , threshold , nonmaxSupression ? 1 : 0 ) ) ;
27+ GC . KeepAlive ( image . Source ) ;
3228 return kp . ToArray ( ) ;
3329 }
3430
@@ -44,14 +40,10 @@ public static KeyPoint[] FAST(InputArray image, int threshold, bool nonmaxSupres
4440 /// <returns>keypoints detected on the image.</returns>
4541 public static KeyPoint [ ] FAST ( InputArray image , int threshold , bool nonmaxSupression , FASTType type )
4642 {
47- if ( image is null )
48- throw new ArgumentNullException ( nameof ( image ) ) ;
49- image . ThrowIfDisposed ( ) ;
50-
5143 using var kp = new StdVector < KeyPoint > ( ) ;
5244 NativeMethods . HandleException (
53- NativeMethods . features_FAST2 ( image . ToInputProxy ( ) , kp . CvPtr , threshold , nonmaxSupression ? 1 : 0 , ( int ) type ) ) ;
54- GC . KeepAlive ( image ) ;
45+ NativeMethods . features_FAST2 ( image . Proxy , kp . CvPtr , threshold , nonmaxSupression ? 1 : 0 , ( int ) type ) ) ;
46+ GC . KeepAlive ( image . Source ) ;
5547 return kp . ToArray ( ) ;
5648 }
5749
@@ -67,14 +59,10 @@ public static KeyPoint[] FAST(InputArray image, int threshold, bool nonmaxSupres
6759 /// <returns>keypoints detected on the image.</returns>
6860 public static KeyPoint [ ] AGAST ( InputArray image , int threshold , bool nonmaxSuppression , AgastFeatureDetector . DetectorType type )
6961 {
70- if ( image is null )
71- throw new ArgumentNullException ( nameof ( image ) ) ;
72- image . ThrowIfDisposed ( ) ;
73-
7462 using var vector = new StdVector < KeyPoint > ( ) ;
7563 NativeMethods . HandleException (
76- NativeMethods . xfeatures2d_AGAST ( image . ToInputProxy ( ) , vector . CvPtr , threshold , nonmaxSuppression ? 1 : 0 , ( int ) type ) ) ;
77- GC . KeepAlive ( image ) ;
64+ NativeMethods . xfeatures2d_AGAST ( image . Proxy , vector . CvPtr , threshold , nonmaxSuppression ? 1 : 0 , ( int ) type ) ) ;
65+ GC . KeepAlive ( image . Source ) ;
7866 return vector . ToArray ( ) ;
7967 }
8068
@@ -93,22 +81,16 @@ public static void DrawKeypoints(
9381 Scalar ? color = null ,
9482 DrawMatchesFlags flags = DrawMatchesFlags . Default )
9583 {
96- if ( image is null )
97- throw new ArgumentNullException ( nameof ( image ) ) ;
98- if ( outImage is null )
99- throw new ArgumentNullException ( nameof ( outImage ) ) ;
10084 if ( keypoints is null )
10185 throw new ArgumentNullException ( nameof ( keypoints ) ) ;
102- image . ThrowIfDisposed ( ) ;
103- outImage . ThrowIfDisposed ( ) ;
10486
10587 var keypointsArray = keypoints . CastOrToArray ( ) ;
10688 var color0 = color . GetValueOrDefault ( Scalar . All ( - 1 ) ) ;
10789 NativeMethods . HandleException (
108- NativeMethods . features_drawKeypoints ( image . ToInputProxy ( ) , keypointsArray , keypointsArray . Length , outImage . ToInputOutputProxy ( ) , color0 , ( int ) flags ) ) ;
90+ NativeMethods . features_drawKeypoints ( image . Proxy , keypointsArray , keypointsArray . Length , outImage . Proxy , color0 , ( int ) flags ) ) ;
10991
110- GC . KeepAlive ( image ) ;
111- GC . KeepAlive ( outImage ) ;
92+ GC . KeepAlive ( image . Source ) ;
93+ GC . KeepAlive ( outImage . Source ) ;
11294 }
11395
11496 /// <summary>
0 commit comments