/// <summary> /// The AgastFeatureDetector constructor /// </summary> /// <param name="threshold">threshold on difference between intensity of the central pixel /// and pixels of a circle around this pixel.</param> /// <param name="nonmaxSuppression">if true, non-maximum suppression is applied to detected corners (keypoints).</param> /// <param name="type"></param> public static AgastFeatureDetector Create( int threshold=10, bool nonmaxSuppression=true, AGASTType type = AGASTType.OAST_9_16) { IntPtr ptr = NativeMethods.features2d_AgastFeatureDetector_create( threshold, nonmaxSuppression ? 1 : 0, (int)type); return new AgastFeatureDetector(ptr); }
/// <summary> /// The AgastFeatureDetector constructor /// </summary> /// <param name="threshold">threshold on difference between intensity of the central pixel /// and pixels of a circle around this pixel.</param> /// <param name="nonmaxSuppression">if true, non-maximum suppression is applied to detected corners (keypoints).</param> /// <param name="type"></param> public static AgastFeatureDetector Create(int threshold = 10, bool nonmaxSuppression = true, AGASTType type = AGASTType.OAST_9_16) { IntPtr ptr = NativeMethods.features2d_AgastFeatureDetector_create( threshold, nonmaxSuppression ? 1 : 0, (int)type); return(new AgastFeatureDetector(ptr)); }
/// <summary> /// Detects corners using the AGAST algorithm /// </summary> /// <param name="image">grayscale image where keypoints (corners) are detected.</param> /// <param name="threshold">threshold on difference between intensity of the central pixel /// and pixels of a circle around this pixel.</param> /// <param name="nonmaxSuppression">if true, non-maximum suppression is applied to /// detected corners (keypoints).</param> /// <param name="type">one of the four neighborhoods as defined in the paper</param> /// <returns>keypoints detected on the image.</returns> public static KeyPoint[] AGAST(InputArray image, int threshold, bool nonmaxSuppression, AGASTType type) { if (image == null) throw new ArgumentNullException(nameof(image)); image.ThrowIfDisposed(); using (var vector = new VectorOfKeyPoint()) { NativeMethods.features2d_AGAST(image.CvPtr, vector.CvPtr, threshold, nonmaxSuppression ? 1 : 0, (int) type); GC.KeepAlive(image); return vector.ToArray(); } }
/// <summary> /// Detects corners using the AGAST algorithm /// </summary> /// <param name="image">grayscale image where keypoints (corners) are detected.</param> /// <param name="threshold">threshold on difference between intensity of the central pixel /// and pixels of a circle around this pixel.</param> /// <param name="nonmaxSuppression">if true, non-maximum suppression is applied to /// detected corners (keypoints).</param> /// <param name="type">one of the four neighborhoods as defined in the paper</param> /// <returns>keypoints detected on the image.</returns> public static KeyPoint[] AGAST(InputArray image, int threshold, bool nonmaxSuppression, AGASTType type) { if (image == null) { throw new ArgumentNullException("image"); } image.ThrowIfDisposed(); using (var vector = new VectorOfKeyPoint()) { NativeMethods.features2d_AGAST(image.CvPtr, vector.CvPtr, threshold, nonmaxSuppression ? 1 : 0, (int)type); GC.KeepAlive(image); return(vector.ToArray()); } }