/// <summary> /// Create a star detector with the specific parameters /// </summary> /// <param name="maxSize"> /// Maximum size of the features. The following /// values of the parameter are supported: /// 4, 6, 8, 11, 12, 16, 22, 23, 32, 45, 46, 64, 90, 128</param> /// <param name="responseThreshold"> /// Threshold for the approximated laplacian, /// used to eliminate weak features. The larger it is, /// the less features will be retrieved /// </param> /// <param name="lineThresholdProjected"> /// Another threshold for the laplacian to eliminate edges. /// The larger the threshold, the more points you get. /// </param> /// <param name="lineThresholdBinarized"> /// Another threshold for the feature size to eliminate edges. /// The larger the threshold, the more points you get.</param> /// <param name="suppressNonmaxSize"> /// /// </param> public StarDetector(int maxSize = 45, int responseThreshold = 30, int lineThresholdProjected = 10, int lineThresholdBinarized = 8, int suppressNonmaxSize = 5) { _ptr = XFeatures2DInvoke.cveStarDetectorCreate(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized, suppressNonmaxSize, ref _feature2D); }
/// <summary> /// Create a Freak descriptor extractor. /// </summary> /// <param name="orientationNormalized">Enable orientation normalization</param> /// <param name="scaleNormalized">Enable scale normalization</param> /// <param name="patternScale">Scaling of the description pattern</param> /// <param name="nOctaves">Number of octaves covered by the detected keypoints.</param> public Freak(bool orientationNormalized = true, bool scaleNormalized = true, float patternScale = 22.0f, int nOctaves = 4) { _ptr = XFeatures2DInvoke.cveFreakCreate(orientationNormalized, scaleNormalized, patternScale, nOctaves, ref _feature2D, ref _sharedPtr); }
/// <summary> /// Release the unmanaged memory associated with this PCTSignaturesSQFD object /// </summary> protected override void DisposeObject() { XFeatures2DInvoke.cvePCTSignaturesRelease(ref _ptr); }
/// <summary> /// Computes Signature Quadratic Form Distance of two signatures. /// </summary> /// <param name="signature0">The first signature.</param> /// <param name="signature1">The second signature.</param> /// <returns>The Signature Quadratic Form Distance of two signatures</returns> public float ComputeQuadraticFormDistance(IInputArray signature0, IInputArray signature1) { using (InputArray iaSignature0 = signature0.GetInputArray()) using (InputArray iaSignature1 = signature1.GetInputArray()) return(XFeatures2DInvoke.cvePCTSignaturesSQFDComputeQuadraticFormDistance(_ptr, iaSignature0, iaSignature1)); }
/// <summary> /// Create a SURF detector using the specific values /// </summary> /// <param name="hessianThresh"> /// Only features with keypoint.hessian larger than that are extracted. /// good default value is ~300-500 (can depend on the average local contrast and sharpness of the image). /// user can further filter out some features based on their hessian values and other characteristics /// </param> /// <param name="extended"> /// false means basic descriptors (64 elements each), /// true means extended descriptors (128 elements each) /// </param> /// <param name="nOctaves"> /// The number of octaves to be used for extraction. /// With each next octave the feature size is doubled /// </param> /// <param name="nOctaveLayers"> /// The number of layers within each octave /// </param> /// <param name="upright"> /// False means that detector computes orientation of each feature. /// True means that the orientation is not computed (which is much, much faster). /// For example, if you match images from a stereo pair, or do image stitching, the matched features likely have very similar angles, and you can speed up feature extraction by setting upright=true.</param> public SURF(double hessianThresh, int nOctaves = 4, int nOctaveLayers = 2, bool extended = true, bool upright = false) { _ptr = XFeatures2DInvoke.cveSURFCreate(hessianThresh, nOctaves, nOctaveLayers, extended, upright, ref _feature2D, ref _sharedPtr); }
/// <summary> /// Create LATCH descriptor extractor /// </summary> /// <param name="bytes">The size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1</param> /// <param name="rotationInvariance">Whether or not the descriptor should compensate for orientation changes.</param> /// <param name="halfSsdSize">the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x /// then the half_ssd_size should be (7-1)/2 = 3.</param> public LATCH(int bytes = 32, bool rotationInvariance = true, int halfSsdSize = 3) { _ptr = XFeatures2DInvoke.cveLATCHCreate(bytes, rotationInvariance, halfSsdSize, ref _feature2D, ref _sharedPtr); }
public BoostDesc(int desc, bool useScaleOrientation, float scalefactor) { _ptr = XFeatures2DInvoke.cveBoostDescCreate(desc, useScaleOrientation, scalefactor, ref _feature2D); }
/// <summary> /// Create a BRIEF descriptor extractor. /// </summary> /// <param name="descriptorSize">The size of descriptor. It can be equal 16, 32 or 64 bytes.</param> public BriefDescriptorExtractor(int descriptorSize = 32) { _ptr = XFeatures2DInvoke.cveBriefDescriptorExtractorCreate(descriptorSize, ref _feature2D); }
/// <summary> /// Creates PCTSignatures algorithm using pre-generated sampling points and number of clusterization seeds. It uses the provided sampling points and generates its own clusterization seed indexes. /// </summary> /// <param name="initSamplingPoints">Sampling points used in image sampling.</param> /// <param name="initSeedCount">Number of initial clusterization seeds. Must be lower or equal to initSamplingPoints.size().</param> public PCTSignatures(VectorOfPointF initSamplingPoints, int initSeedCount) { _ptr = XFeatures2DInvoke.cvePCTSignaturesCreate2(initSamplingPoints, initSeedCount, ref _sharedPtr); }
/// <summary> /// Creates PCTSignatures algorithm using pre-generated sampling points and clusterization seeds indexes. /// </summary> /// <param name="initSamplingPoints">Sampling points used in image sampling.</param> /// <param name="initClusterSeedIndexes">Indexes of initial clusterization seeds. Its size must be lower or equal to initSamplingPoints.size().</param> public PCTSignatures(VectorOfPointF initSamplingPoints, VectorOfInt initClusterSeedIndexes) { _ptr = XFeatures2DInvoke.cvePCTSignaturesCreate3(initSamplingPoints, initClusterSeedIndexes, ref _sharedPtr); }
/// <summary> /// Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes. /// </summary> /// <param name="initSampleCount">Number of points used for image sampling.</param> /// <param name="initSeedCount">Number of initial clusterization seeds. Must be lower or equal to initSampleCount</param> /// <param name="pointDistribution">Distribution of generated points.</param> public PCTSignatures(int initSampleCount = 2000, int initSeedCount = 400, PointDistributionType pointDistribution = PointDistributionType.Uniform) { _ptr = XFeatures2DInvoke.cvePCTSignaturesCreate(initSampleCount, initSeedCount, pointDistribution, ref _sharedPtr); }
/// <summary> /// Obtain a GpuMat from the keypoints array /// </summary> /// <param name="src">The keypoints array</param> /// <param name="dst">A GpuMat that represent the keypoints</param> public void UploadKeypoints(VectorOfKeyPoint src, GpuMat dst) { XFeatures2DInvoke.cudaSURFUploadKeypoints(_ptr, src, dst); }
/// <summary> /// Obtain the keypoints array from GpuMat /// </summary> /// <param name="src">The keypoints obtained from DetectKeyPointsRaw</param> /// <param name="dst">The vector of keypoints</param> public void DownloadKeypoints(GpuMat src, VectorOfKeyPoint dst) { XFeatures2DInvoke.cudaSURFDownloadKeypoints(_ptr, src, dst); }
/// <summary> /// Release the unmanaged resource associate to the Detector /// </summary> protected override void DisposeObject() { XFeatures2DInvoke.cudaSURFDetectorRelease(ref _ptr); }
/// <summary> /// Create a locally uniform comparison image descriptor. /// </summary> /// <param name="lucidKernel">Kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth</param> /// <param name="blurKernel">kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth</param> public LUCID(int lucidKernel = 1, int blurKernel = 2) { _ptr = XFeatures2DInvoke.cveLUCIDCreate(lucidKernel, blurKernel, ref _feature2D, ref _sharedPtr); }