本文整理汇总了C#中Ptr类的典型用法代码示例。如果您正苦于以下问题:C# Ptr类的具体用法?C# Ptr怎么用?C# Ptr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ptr类属于命名空间,在下文中一共展示了Ptr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static new BRISK FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<BRISK> pointer");
var ptrObj = new Ptr<BRISK>(ptr);
return new BRISK(ptrObj);
}
开发者ID:kaorun55,项目名称:opencvsharp,代码行数:12,代码来源:BRISK.cs
示例2: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal new static FlannBasedMatcher FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<FlannBasedMatcher> pointer");
var ptrObj = new Ptr<FlannBasedMatcher>(ptr);
return new FlannBasedMatcher(ptrObj);
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:12,代码来源:FlannBasedMatcher.cs
示例3: Dispose
/// <summary>
/// リソースの解放
/// </summary>
/// <param name="disposing">
/// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。
/// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。
///</param>
#else
/// <summary>
/// Releases the resources
/// </summary>
/// <param name="disposing">
/// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
/// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
/// </param>
#endif
protected override void Dispose(bool disposing)
{
if (!disposed)
{
try
{
// releases managed resources
if (disposing)
{
}
// releases unmanaged resources
if (IsEnabledDispose)
{
ptrObj?.Dispose();
ptrObj = null;
ptr = IntPtr.Zero;
}
disposed = true;
}
finally
{
base.Dispose(disposing);
}
}
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:41,代码来源:LineSegmentDetector.cs
示例4: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static new StarDetector FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<StarDetector> pointer");
var ptrObj = new Ptr<StarDetector>(ptr);
return new StarDetector(ptrObj);
}
开发者ID:kaorun55,项目名称:opencvsharp,代码行数:12,代码来源:StarDetector.cs
示例5: Configure
private Ptr<RPC_SERVER_INTERFACE> Configure(RpcHandle handle, Ptr<MIDL_SERVER_INFO> me, Guid iid,
Byte[] formatTypes, Byte[] formatProc, ushort[] formatProcOffsets,
Delegate[] funcs)
{
Ptr<RPC_SERVER_INTERFACE> svrIface = handle.CreatePtr(new RPC_SERVER_INTERFACE(handle, me, iid));
Ptr<MIDL_STUB_DESC> stub = handle.CreatePtr(new MIDL_STUB_DESC(handle, svrIface.Handle, formatTypes, true));
pStubDesc = stub.Handle;
var dispatches = new IntPtr[funcs.Length];
for (var i = 0; i < funcs.Length; ++i)
{
dispatches[i] = handle.PinFunction(funcs[i]);
}
DispatchTable = handle.Pin(dispatches);
ProcString = handle.Pin(formatProc);
FmtStringOffset = handle.Pin(formatProcOffsets.Clone());
ThunkTable = IntPtr.Zero;
pTransferSyntax = IntPtr.Zero;
nCount = IntPtr.Zero;
pSyntaxInfo = IntPtr.Zero;
//Copy us back into the pinned address
Marshal.StructureToPtr(this, me.Handle, false);
return svrIface;
}
开发者ID:terryfan1109,项目名称:win32-test,代码行数:27,代码来源:MIDL_SERVER_INFO.cs
示例6: Dispose
/// <summary>
/// リソースの解放
/// </summary>
/// <param name="disposing">
/// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。
/// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。
///</param>
#else
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">
/// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
/// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
/// </param>
#endif
protected override void Dispose(bool disposing)
{
if (!disposed)
{
try
{
if (disposing)
{
}
if (IsEnabledDispose)
{
if (objectPtr != null)
{
objectPtr.Dispose();
}
objectPtr = null;
ptr = IntPtr.Zero;
}
disposed = true;
}
finally
{
base.Dispose(disposing);
}
}
}
开发者ID:rblenis,项目名称:opencvsharp,代码行数:42,代码来源:BackgroundSubtractorMog2.cs
示例7: Dispose
/// <summary>
/// リソースの解放
/// </summary>
/// <param name="disposing">
/// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。
/// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。
///</param>
#else
/// <summary>
/// Releases the resources
/// </summary>
/// <param name="disposing">
/// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
/// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
/// </param>
#endif
protected override void Dispose(bool disposing)
{
if (!disposed)
{
try
{
// releases managed resources
if (disposing)
{
if (detectorPtr != null)
{
detectorPtr.Dispose();
detectorPtr = null;
}
}
// releases unmanaged resources
ptr = IntPtr.Zero;
disposed = true;
}
finally
{
base.Dispose(disposing);
}
}
}
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:42,代码来源:SIFT.cs
示例8: BackgroundSubtractorMOG2
/// <summary>
/// the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength
/// </summary>
/// <param name="history"></param>
/// <param name="varThreshold"></param>
/// <param name="bShadowDetection"></param>
public BackgroundSubtractorMOG2(int history, float varThreshold, bool bShadowDetection = true)
{
IntPtr po = NativeMethods.video_BackgroundSubtractorMOG2_new2(history, varThreshold, bShadowDetection ? 1 : 0);
if (po == IntPtr.Zero)
throw new OpenCvSharpException("Failed to create BackgroundSubtractorMOG2");
objectPtr = new Ptr<BackgroundSubtractorMOG2>(po);
ptr = objectPtr.Obj;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:14,代码来源:BackgroundSubtractorMog2.cs
示例9: BackgroundSubtractorMOG
/// <summary>
/// the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength
/// </summary>
/// <param name="history"></param>
/// <param name="nmixtures"></param>
/// <param name="backgroundRatio"></param>
/// <param name="noiseSigma"></param>
public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma=0)
{
IntPtr po = NativeMethods.video_BackgroundSubtractorMOG_new2(history, nmixtures, backgroundRatio, noiseSigma);
if (po == IntPtr.Zero)
throw new OpenCvSharpException("Failed to create BackgroundSubtractorMOG");
objectPtr = new Ptr<BackgroundSubtractorMOG>(po);
ptr = objectPtr.Obj;
}
开发者ID:jorik041,项目名称:opencvsharp,代码行数:15,代码来源:BackgroundSubtractorMOG.cs
示例10: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal new static BriefDescriptorExtractor FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid BriefDescriptorExtractor pointer");
var ptrObj = new Ptr<BriefDescriptorExtractor>(ptr);
var extractor = new BriefDescriptorExtractor(ptrObj,ptrObj.Obj);
return extractor;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:14,代码来源:BriefDescriptorExtractor.cs
示例11: SURF
/// <summary>
/// SURF初期化
/// </summary>
/// <param name="hessianThreshold">keypoint.hessian の値がこの閾値よりも大きい特徴だけが検出される</param>
/// <param name="nOctaves"></param>
/// <param name="nOctaveLayers"></param>
/// <param name="extended">false:基本的なディスクリプタ(64要素), true:拡張されたディスクリプタ(128要素)</param>
/// <param name="upright"></param>
#else
/// <summary>
/// The SURF constructor.
/// </summary>
/// <param name="hessianThreshold">Only features with keypoint.hessian larger than that are extracted. </param>
/// <param name="nOctaves">The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default.
/// If you want to get very large features, use the larger value. If you want just small features, decrease it.</param>
/// <param name="nOctaveLayers">The number of images within each octave of a gaussian pyramid. It is set to 2 by default.</param>
/// <param name="extended">false means basic descriptors (64 elements each), true means extended descriptors (128 elements each) </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).</param>
#endif
public SURF(double hessianThreshold,
int nOctaves = 4, int nOctaveLayers = 2,
bool extended = true, bool upright = false)
: base()
{
ptr = NativeMethods.nonfree_SURF_new(hessianThreshold, nOctaves, nOctaveLayers,
extended ? 1 : 0, upright ? 1 : 0);
detectorPtr = null;
}
开发者ID:MJunak,项目名称:opencvsharp,代码行数:29,代码来源:SURF.cs
示例12: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static new BackgroundSubtractorMOG FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid BackgroundSubtractorMOG pointer");
var ptrObj = new Ptr<BackgroundSubtractorMOG>(ptr);
var obj = new BackgroundSubtractorMOG(ptrObj, ptrObj.Obj);
return obj;
}
开发者ID:jorik041,项目名称:opencvsharp,代码行数:14,代码来源:BackgroundSubtractorMOG.cs
示例13: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static FrameSource FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid FrameSource pointer");
var obj = new FrameSourceImpl();
var ptrObj = new Ptr<FrameSource>(ptr);
obj.ptrObj = ptrObj;
obj.ptr = ptr;
return obj;
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:15,代码来源:FrameSourceImpl.cs
示例14: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static DescriptorMatcher FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<DescriptorMatcher> pointer");
var ptrObj = new Ptr<DescriptorMatcher>(ptr);
var detector = new DescriptorMatcher
{
detectorPtr = ptrObj,
ptr = ptrObj.Obj
};
return detector;
}
开发者ID:jorik041,项目名称:opencvsharp,代码行数:17,代码来源:DescriptorMatcher.cs
示例15: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static Feature2D FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<Feature2D> pointer");
var ptrObj = new Ptr<Feature2D>(ptr);
var detector = new Feature2D
{
ptrObj = ptrObj,
ptr = ptrObj.Get()
};
return detector;
}
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:17,代码来源:Feature2D.cs
示例16: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static FaceRecognizer FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid cv::Ptr<FaceRecognizer> pointer");
var ptrObj = new Ptr<FaceRecognizer>(ptr);
var detector = new FaceRecognizer
{
recognizerPtr = ptrObj,
ptr = ptrObj.Obj
};
return detector;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:17,代码来源:FaceRecognizer.cs
示例17: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static SuperResolutionImpl FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid FrameSource pointer");
var ptrObj = new Ptr<SuperResolution>(ptr);
var obj = new SuperResolutionImpl
{
detectorPtr = ptrObj,
ptr = ptrObj.Obj
};
return obj;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:18,代码来源:SuperResolutionImpl.cs
示例18: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static DescriptorExtractor FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid DescriptorExtractor pointer");
var ptrObj = new Ptr<DescriptorExtractor>(ptr);
var extractor = new DescriptorExtractor
{
extractorPtr = ptrObj,
ptr = ptrObj.Obj
};
return extractor;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:18,代码来源:DescriptorExtractor.cs
示例19: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static FeatureDetector FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid FeatureDetector pointer");
var ptrObj = new Ptr<FeatureDetector>(ptr);
var detector = new FeatureDetector
{
detectorPtr = ptrObj,
ptr = ptrObj.Obj
};
return detector;
}
开发者ID:healtech,项目名称:opencvsharp,代码行数:18,代码来源:FeatureDetector.cs
示例20: FromPtr
/// <summary>
/// Creates instance from cv::Ptr<T> .
/// ptr is disposed when the wrapper disposes.
/// </summary>
/// <param name="ptr"></param>
internal static CLAHE FromPtr(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
throw new OpenCvSharpException("Invalid CLAHE pointer");
var ptrObj = new Ptr<CLAHE>(ptr);
var ret = new CLAHE
{
ptr = ptrObj.Obj,
ptrObj = ptrObj,
};
return ret;
}
开发者ID:0sv,项目名称:opencvsharp,代码行数:18,代码来源:CLAHE.cs
注:本文中的Ptr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论