OpenCvSharp.Feature2D.Detect C# (CSharp) Method

Detect() public method

Detect keypoints in an image.
public Detect ( InputArray image, OpenCvSharp.Mat mask = null ) : KeyPoint[]
image InputArray The image.
mask OpenCvSharp.Mat Mask specifying where to look for keypoints (optional). /// Must be a char matrix with non-zero values in the region of interest.
return KeyPoint[]
        public KeyPoint[] Detect(InputArray image, Mat mask = null)
        {
            if (image == null)
                throw new ArgumentNullException(nameof(image));
            if (disposed)
                throw new ObjectDisposedException(GetType().Name);

            image.ThrowIfDisposed();
            try
            {
                using (var keypoints = new VectorOfKeyPoint())
                {
                    NativeMethods.features2d_Feature2D_detect_InputArray(ptr, image.CvPtr, keypoints.CvPtr,
                        Cv2.ToPtr(mask));
                    return keypoints.ToArray();
                }
            }
            finally
            {
                GC.KeepAlive(image);
                GC.KeepAlive(mask);
            }
        }

Same methods

Feature2D::Detect ( OpenCvSharp.Mat image, OpenCvSharp.Mat mask = null ) : KeyPoint[]
Feature2D::Detect ( IEnumerable images, IEnumerable masks = null ) : KeyPoint[][]