mirror of https://github.com/emgucv/emgucv.git

20 changed files with 351 additions and 109 deletions
-
17Emgu.CV.Contrib/XFeatures2D/BriefDescriptorExtractor.cs
-
16Emgu.CV.Contrib/XFeatures2D/CudaSURF.cs
-
93Emgu.CV.Contrib/XFeatures2D/DAISY.cs
-
18Emgu.CV.Contrib/XFeatures2D/Freak.cs
-
66Emgu.CV.Contrib/XFeatures2D/LATCH.cs
-
58Emgu.CV.Contrib/XFeatures2D/LUCID.cs
-
14Emgu.CV.Contrib/XFeatures2D/SIFT.cs
-
14Emgu.CV.Contrib/XFeatures2D/SURF.cs
-
20Emgu.CV.Contrib/XFeatures2D/StarDetector.cs
-
4Emgu.CV.Example/SURFFeature/DrawMatches.cs
-
4Emgu.CV.Example/TrafficSignRecognition/StopSignDetector.cs
-
8Emgu.CV.Extern/xfeatures2d/nonfree_c.cpp
-
8Emgu.CV.Extern/xfeatures2d/nonfree_c.h
-
24Emgu.CV.Extern/xfeatures2d/xfeatures2d_c.cpp
-
12Emgu.CV.Extern/xfeatures2d/xfeatures2d_c.h
-
6Emgu.CV.Test/AutoTestCuda.cs
-
70Emgu.CV.Test/AutoTestFeatures2d.cs
-
2Emgu.CV.Test/AutoTestVarious.cs
-
4Emgu.CV.Test/Class1.cs
-
2Emgu.CV/Features2D/Feature2D.cs
@ -0,0 +1,93 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2015 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using Emgu.CV; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
using Emgu.CV.Features2D; |
|||
|
|||
namespace Emgu.CV.XFeatures2D |
|||
{ |
|||
/// <summary>
|
|||
/// Daisy descriptor.
|
|||
/// </summary>
|
|||
public class DAISY : Feature2D |
|||
{ |
|||
/// <summary>
|
|||
/// Create DAISY descriptor extractor
|
|||
/// </summary>
|
|||
/// <param name="radius">Radius of the descriptor at the initial scale.</param>
|
|||
/// <param name="qRadius">Amount of radial range division quantity.</param>
|
|||
/// <param name="qTheta">Amount of angular range division quantity.</param>
|
|||
/// <param name="qHist">Amount of gradient orientations range division quantity.</param>
|
|||
/// <param name="norm">Descriptors normalization type.</param>
|
|||
/// <param name="H">optional 3x3 homography matrix used to warp the grid of daisy but sampling keypoints remains unwarped on image</param>
|
|||
/// <param name="interpolation">Switch to disable interpolation for speed improvement at minor quality loss</param>
|
|||
/// <param name="useOrientation">Sample patterns using keypoints orientation, disabled by default.</param>
|
|||
public DAISY(float radius = 15, int qRadius = 3, int qTheta = 8, |
|||
int qHist = 8, NormalizationType norm = NormalizationType.None, IInputArray H = null, |
|||
bool interpolation = true, bool useOrientation = false) |
|||
{ |
|||
using (InputArray iaH = H == null ? InputArray.GetEmpty() : H.GetInputArray()) |
|||
_ptr = ContribInvoke.cveDAISYCreate(radius, qRadius, qTheta, qHist, norm, iaH, interpolation, useOrientation, |
|||
ref _feature2D); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Normalization type
|
|||
/// </summary>
|
|||
public enum NormalizationType |
|||
{ |
|||
/// <summary>
|
|||
/// Will not do any normalization (default)
|
|||
/// </summary>
|
|||
None = 100, |
|||
/// <summary>
|
|||
/// Histograms are normalized independently for L2 norm equal to 1.0
|
|||
/// </summary>
|
|||
Partial = 101, |
|||
/// <summary>
|
|||
/// Descriptors are normalized for L2 norm equal to 1.0
|
|||
/// </summary>
|
|||
Full = 102, |
|||
/// <summary>
|
|||
/// Descriptors are normalized for L2 norm equal to 1.0 but no individual one is bigger than 0.154 as in SIFT
|
|||
/// </summary>
|
|||
SIFT = 103 |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Release all the unmanaged resource associated with BRIEF
|
|||
/// </summary>
|
|||
protected override void DisposeObject() |
|||
{ |
|||
if (_ptr != IntPtr.Zero) |
|||
{ |
|||
ContribInvoke.cveDAISYRelease(ref _ptr); |
|||
} |
|||
base.DisposeObject(); |
|||
} |
|||
} |
|||
|
|||
public static partial class ContribInvoke |
|||
{ |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static IntPtr cveDAISYCreate( |
|||
float radius, int qRadius, int qTheta, |
|||
int qHist, DAISY.NormalizationType norm, IntPtr H, |
|||
bool interpolation, bool useOrientation, |
|||
ref IntPtr daisy); |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static void cveDAISYRelease(ref IntPtr daisy); |
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2015 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using Emgu.CV; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
using Emgu.CV.Features2D; |
|||
|
|||
namespace Emgu.CV.XFeatures2D |
|||
{ |
|||
/// <summary>
|
|||
/// latch Class for computing the LATCH descriptor.
|
|||
/// If you find this code useful, please add a reference to the following paper in your work:
|
|||
/// Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015
|
|||
/// LATCH is a binary descriptor based on learned comparisons of triplets of image patches.
|
|||
/// </summary>
|
|||
public class LATCH : Feature2D |
|||
{ |
|||
/// <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 = ContribInvoke.cveLATCHCreate(bytes, rotationInvariance, halfSsdSize, ref _feature2D); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Release all the unmanaged resource associated with BRIEF
|
|||
/// </summary>
|
|||
protected override void DisposeObject() |
|||
{ |
|||
if (_ptr != IntPtr.Zero) |
|||
{ |
|||
ContribInvoke.cveLATCHRelease(ref _ptr); |
|||
} |
|||
base.DisposeObject(); |
|||
} |
|||
} |
|||
|
|||
public static partial class ContribInvoke |
|||
{ |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static IntPtr cveLATCHCreate( |
|||
int bytes, |
|||
[MarshalAs(CvInvoke.BoolMarshalType)] |
|||
bool rotationInvariance, |
|||
int halfSsdSize, |
|||
ref IntPtr extractor); |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static void cveLATCHRelease(ref IntPtr extractor); |
|||
} |
|||
} |
@ -0,0 +1,58 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2015 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using Emgu.CV; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
using Emgu.CV.Features2D; |
|||
|
|||
namespace Emgu.CV.XFeatures2D |
|||
{ |
|||
/// <summary>
|
|||
/// The locally uniform comparison image descriptor:
|
|||
/// An image descriptor that can be computed very fast, while being
|
|||
/// about as robust as, for example, SURF or BRIEF.
|
|||
/// </summary>
|
|||
public class LUCID : Feature2D |
|||
{ |
|||
/// <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 = ContribInvoke.cveLUCIDCreate(lucidKernel, blurKernel, ref _feature2D); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Release all the unmanaged resource associated with BRIEF
|
|||
/// </summary>
|
|||
protected override void DisposeObject() |
|||
{ |
|||
if (_ptr != IntPtr.Zero) |
|||
{ |
|||
ContribInvoke.cveLUCIDRelease(ref _ptr); |
|||
} |
|||
base.DisposeObject(); |
|||
} |
|||
} |
|||
|
|||
public static partial class ContribInvoke |
|||
{ |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static IntPtr cveLUCIDCreate(int lucidKernel, int blurKernel, ref IntPtr feature2D); |
|||
|
|||
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal extern static void cveLUCIDRelease(ref IntPtr extractor); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue