OpenCvSharp.Feature2D.Compute C# (CSharp) Method

Compute() public method

Compute the descriptors for a keypoints collection detected in image collection.
public Compute ( IEnumerable images, KeyPoint &keypoints, IEnumerable descriptors ) : void
images IEnumerable Image collection.
keypoints KeyPoint Input keypoints collection. keypoints[i] is keypoints detected in images[i]. /// Keypoints for which a descriptor cannot be computed are removed.
descriptors IEnumerable Descriptor collection. descriptors[i] are descriptors computed for set keypoints[i].
return void
        public virtual void Compute(IEnumerable<Mat> images, ref KeyPoint[][] keypoints, IEnumerable<Mat> descriptors)
        {
            if (disposed)
                throw new ObjectDisposedException(GetType().Name);
            if (images == null)
                throw new ArgumentNullException(nameof(images));
            if (descriptors == null)
                throw new ArgumentNullException(nameof(descriptors));

            IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images);
            IntPtr[] descriptorsPtrs = EnumerableEx.SelectPtrs(descriptors);

            using (var keypointsVec = new VectorOfVectorKeyPoint(keypoints))
            {
                NativeMethods.features2d_Feature2D_compute2(
                    ptr, imagesPtrs, imagesPtrs.Length, keypointsVec.CvPtr,
                    descriptorsPtrs, descriptorsPtrs.Length);

                keypoints = keypointsVec.ToArray();
            }
        }

Same methods

Feature2D::Compute ( InputArray image, KeyPoint inKeypoints, KeyPoint &outKeypoints, OutputArray descriptors ) : void
Feature2D::Compute ( InputArray image, KeyPoint &keypoints, OutputArray descriptors ) : void