123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.MlModule
- {
- // C++: class ParamGrid
- /**
- * The structure represents the logarithmic grid range of statmodel parameters.
- *
- * It is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate
- * being computed by cross-validation.
- */
- public class ParamGrid : DisposableOpenCVObject
- {
- protected override void Dispose(bool disposing)
- {
- try
- {
- if (disposing)
- {
- }
- if (IsEnabledDispose)
- {
- if (nativeObj != IntPtr.Zero)
- ml_ParamGrid_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- }
- finally
- {
- base.Dispose(disposing);
- }
- }
- protected internal ParamGrid(IntPtr addr) : base(addr) { }
- public IntPtr getNativeObjAddr() { return nativeObj; }
- // internal usage only
- public static ParamGrid __fromPtr__(IntPtr addr) { return new ParamGrid(addr); }
- //
- // C++: static Ptr_ParamGrid cv::ml::ParamGrid::create(double minVal = 0., double maxVal = 0., double logstep = 1.)
- //
- /**
- * Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method
- *
- * param minVal minimum value of the parameter grid
- * param maxVal maximum value of the parameter grid
- * param logstep Logarithmic step for iterating the statmodel parameter
- * return automatically generated
- */
- public static ParamGrid create(double minVal, double maxVal, double logstep)
- {
- return ParamGrid.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(ml_ParamGrid_create_10(minVal, maxVal, logstep)));
- }
- /**
- * Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method
- *
- * param minVal minimum value of the parameter grid
- * param maxVal maximum value of the parameter grid
- * return automatically generated
- */
- public static ParamGrid create(double minVal, double maxVal)
- {
- return ParamGrid.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(ml_ParamGrid_create_11(minVal, maxVal)));
- }
- /**
- * Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method
- *
- * param minVal minimum value of the parameter grid
- * return automatically generated
- */
- public static ParamGrid create(double minVal)
- {
- return ParamGrid.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(ml_ParamGrid_create_12(minVal)));
- }
- /**
- * Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method
- *
- * return automatically generated
- */
- public static ParamGrid create()
- {
- return ParamGrid.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(ml_ParamGrid_create_13()));
- }
- //
- // C++: double ParamGrid::minVal
- //
- public double get_minVal()
- {
- ThrowIfDisposed();
- return ml_ParamGrid_get_1minVal_10(nativeObj);
- }
- //
- // C++: void ParamGrid::minVal
- //
- public void set_minVal(double minVal)
- {
- ThrowIfDisposed();
- ml_ParamGrid_set_1minVal_10(nativeObj, minVal);
- }
- //
- // C++: double ParamGrid::maxVal
- //
- public double get_maxVal()
- {
- ThrowIfDisposed();
- return ml_ParamGrid_get_1maxVal_10(nativeObj);
- }
- //
- // C++: void ParamGrid::maxVal
- //
- public void set_maxVal(double maxVal)
- {
- ThrowIfDisposed();
- ml_ParamGrid_set_1maxVal_10(nativeObj, maxVal);
- }
- //
- // C++: double ParamGrid::logStep
- //
- public double get_logStep()
- {
- ThrowIfDisposed();
- return ml_ParamGrid_get_1logStep_10(nativeObj);
- }
- //
- // C++: void ParamGrid::logStep
- //
- public void set_logStep(double logStep)
- {
- ThrowIfDisposed();
- ml_ParamGrid_set_1logStep_10(nativeObj, logStep);
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: static Ptr_ParamGrid cv::ml::ParamGrid::create(double minVal = 0., double maxVal = 0., double logstep = 1.)
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_ParamGrid_create_10(double minVal, double maxVal, double logstep);
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_ParamGrid_create_11(double minVal, double maxVal);
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_ParamGrid_create_12(double minVal);
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_ParamGrid_create_13();
- // C++: double ParamGrid::minVal
- [DllImport(LIBNAME)]
- private static extern double ml_ParamGrid_get_1minVal_10(IntPtr nativeObj);
- // C++: void ParamGrid::minVal
- [DllImport(LIBNAME)]
- private static extern void ml_ParamGrid_set_1minVal_10(IntPtr nativeObj, double minVal);
- // C++: double ParamGrid::maxVal
- [DllImport(LIBNAME)]
- private static extern double ml_ParamGrid_get_1maxVal_10(IntPtr nativeObj);
- // C++: void ParamGrid::maxVal
- [DllImport(LIBNAME)]
- private static extern void ml_ParamGrid_set_1maxVal_10(IntPtr nativeObj, double maxVal);
- // C++: double ParamGrid::logStep
- [DllImport(LIBNAME)]
- private static extern double ml_ParamGrid_get_1logStep_10(IntPtr nativeObj);
- // C++: void ParamGrid::logStep
- [DllImport(LIBNAME)]
- private static extern void ml_ParamGrid_set_1logStep_10(IntPtr nativeObj, double logStep);
- // native support for java finalize()
- [DllImport(LIBNAME)]
- private static extern void ml_ParamGrid_delete(IntPtr nativeObj);
- }
- }
|