OpenCvSharp.NativeMethods.features2d_BOWImgDescriptorExtractor_compute12 C# (CSharp) Method

features2d_BOWImgDescriptorExtractor_compute12() private method

private features2d_BOWImgDescriptorExtractor_compute12 ( IntPtr obj, IntPtr keypointDescriptors, IntPtr imgDescriptor, IntPtr pointIdxsOfClusters ) : void
obj IntPtr
keypointDescriptors IntPtr
imgDescriptor IntPtr
pointIdxsOfClusters IntPtr
return void
        public static extern void features2d_BOWImgDescriptorExtractor_compute12(
            IntPtr obj, IntPtr keypointDescriptors,
            IntPtr imgDescriptor, IntPtr pointIdxsOfClusters);
        [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)]

Usage Example

コード例 #1
0
        /// <summary>
        /// Computes an image descriptor using the set visual vocabulary.
        /// </summary>
        /// <param name="keypointDescriptors">Computed descriptors to match with vocabulary.</param>
        /// <param name="imgDescriptor">Computed output image descriptor.</param>
        /// <param name="pointIdxsOfClusters">Indices of keypoints that belong to the cluster.
        /// This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster(word of vocabulary) returned if it is non-zero.</param>
        public void Compute(InputArray keypointDescriptors, OutputArray imgDescriptor, out int[][] pointIdxsOfClusters)
        {
            ThrowIfDisposed();
            if (keypointDescriptors == null)
            {
                throw new ArgumentNullException(nameof(keypointDescriptors));
            }
            if (imgDescriptor == null)
            {
                throw new ArgumentNullException(nameof(imgDescriptor));
            }

            using (var pointIdxsOfClustersVec = new VectorOfVectorInt())
            {
                NativeMethods.features2d_BOWImgDescriptorExtractor_compute12(
                    ptr, keypointDescriptors.CvPtr, imgDescriptor.CvPtr, pointIdxsOfClustersVec.CvPtr);
                pointIdxsOfClusters = pointIdxsOfClustersVec.ToArray();
            }
            GC.KeepAlive(keypointDescriptors);
            GC.KeepAlive(imgDescriptor);
        }
NativeMethods