Skip to content

Commit

Permalink
cv::Ptr<T> bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
shimat committed Nov 5, 2016
1 parent 6a83bed commit 3aa0c61
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/AKAZE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class AKAZE : Feature2D
private bool disposed;
private Ptr<AKAZE> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/OpenCvSharp/modules/features2d/AgastFeatureDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ namespace OpenCvSharp
public class AgastFeatureDetector : Feature2D
{
private bool disposed;
private Ptr<AgastFeatureDetector> ptrObj;
internal Ptr<AgastFeatureDetector> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#pragma warning disable 1591
public const int
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/BFMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class BFMatcher : DescriptorMatcher
private bool disposed;
private Ptr<BFMatcher> detectorPtr;

internal override IntPtr PtrObj => detectorPtr.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public BOWImgDescriptorExtractor(Feature2D dextractor, DescriptorMatcher dmatche
throw new ArgumentNullException(nameof(dextractor));
if (dmatcher == null)
throw new ArgumentNullException(nameof(dmatcher));
ptr = NativeMethods.features2d_BOWImgDescriptorExtractor_new1(dextractor.ptrObj.CvPtr,
dmatcher.detectorPtr.CvPtr);
ptr = NativeMethods.features2d_BOWImgDescriptorExtractor_new1(dextractor.PtrObj, dmatcher.PtrObj);
}

/// <summary>
Expand All @@ -33,7 +32,7 @@ public BOWImgDescriptorExtractor(DescriptorMatcher dmatcher)
{
if (dmatcher == null)
throw new ArgumentNullException(nameof(dmatcher));
ptr = NativeMethods.features2d_BOWImgDescriptorExtractor_new2(dmatcher.detectorPtr.CvPtr);
ptr = NativeMethods.features2d_BOWImgDescriptorExtractor_new2(dmatcher.PtrObj);
}

#if LANG_JP
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/BRISK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class BRISK : Feature2D
private bool disposed;
private Ptr<BRISK> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/OpenCvSharp/modules/features2d/DescriptorMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class DescriptorMatcher : Algorithm
/// <summary>
///
/// </summary>
internal Ptr<DescriptorMatcher> detectorPtr;
private Ptr<DescriptorMatcher> detectorPtr;

internal virtual IntPtr PtrObj => detectorPtr.CvPtr;

#region Init & Disposal

Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/FastFeatureDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class FastFeatureDetector : Feature2D
private bool disposed;
private Ptr<FastFeatureDetector> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/OpenCvSharp/modules/features2d/Feature2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class Feature2D : Algorithm
/// <summary>
/// cv::Ptr&lt;Feature2D&gt;
/// </summary>
internal Ptr<Feature2D> ptrObj;
private Ptr<Feature2D> ptrObj;

internal virtual IntPtr PtrObj => ptrObj.CvPtr;

/// <summary>
///
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/FlannBasedMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class FlannBasedMatcher : DescriptorMatcher
private bool disposed;
private Ptr<FlannBasedMatcher> detectorPtr;

internal override IntPtr PtrObj => detectorPtr.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/GFTTDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class GFTTDetector : Feature2D
private bool disposed;
private Ptr<GFTTDetector> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/KAZE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class KAZE : Feature2D
private bool disposed;
private Ptr<KAZE> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/MSER.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class MSER : Feature2D
private bool disposed;
private Ptr<MSER> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/ORB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class ORB : Feature2D
private bool disposed;
private Ptr<ORB> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/features2d/SimpleBlobDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class SimpleBlobDetector : Feature2D
private bool disposed;
private Ptr<SimpleBlobDetector> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

/// <summary>
/// SimpleBlobDetector parameters
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class BriefDescriptorExtractor : DescriptorExtractor
/// </summary>
private Ptr<BriefDescriptorExtractor> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

/// <summary>
///
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/xfeatures2d/FREAK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class FREAK : Feature2D
private bool disposed;
private Ptr<FREAK> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenCvSharp/modules/xfeatures2d/StarDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class StarDetector : Feature2D
private bool disposed;
private Ptr<StarDetector> ptrObj;

internal override IntPtr PtrObj => ptrObj.CvPtr;

#region Init & Disposal

/// <summary>
Expand Down

0 comments on commit 3aa0c61

Please sign in to comment.