You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

47 lines
1.2 KiB

//----------------------------------------------------------------------------
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
//----------------------------------------------------------------------------
using System;
using System.Diagnostics;
using Emgu.Util;
namespace Emgu.CV.ML
{
/// <summary>
/// The KNearest classifier
/// </summary>
public partial class KNearest : UnmanagedObject, IStatModel
{
private IntPtr _statModelPtr;
private IntPtr _algorithmPtr;
/// <summary>
/// Create a default KNearest classifier
/// </summary>
public KNearest()
{
_ptr = MlInvoke.CvKNearestCreate(ref _statModelPtr, ref _algorithmPtr);
}
/// <summary>
/// Release the classifier and all the memory associated with it
/// </summary>
protected override void DisposeObject()
{
MlInvoke.CvKNearestRelease(ref _ptr);
_statModelPtr = IntPtr.Zero;
_algorithmPtr = IntPtr.Zero;
}
IntPtr IStatModel.StatModelPtr
{
get { return _statModelPtr; }
}
IntPtr IAlgorithm.AlgorithmPtr
{
get { return _algorithmPtr; }
}
}
}