123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.MlModule
- {
- // C++: class DTrees
- //javadoc: DTrees
- public class DTrees : StatModel
- {
- protected override void Dispose (bool disposing)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
- try {
- if (disposing) {
- }
- if (IsEnabledDispose) {
- if (nativeObj != IntPtr.Zero)
- ml_DTrees_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal DTrees (IntPtr addr) : base (addr) { }
- // internal usage only
- public static new DTrees __fromPtr__ (IntPtr addr) { return new DTrees (addr); }
- // C++: enum Flags
- public const int PREDICT_AUTO = 0;
- public const int PREDICT_SUM = (1 << 8);
- public const int PREDICT_MAX_VOTE = (2 << 8);
- public const int PREDICT_MASK = (3 << 8);
- //
- // C++: Mat cv::ml::DTrees::getPriors()
- //
- //javadoc: DTrees::getPriors()
- public Mat getPriors ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Mat retVal = new Mat(ml_DTrees_getPriors_10(nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_DTrees cv::ml::DTrees::create()
- //
- //javadoc: DTrees::create()
- public static DTrees create ()
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- DTrees retVal = DTrees.__fromPtr__(ml_DTrees_create_10());
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_DTrees cv::ml::DTrees::load(String filepath, String nodeName = String())
- //
- //javadoc: DTrees::load(filepath, nodeName)
- public static DTrees load (string filepath, string nodeName)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- DTrees retVal = DTrees.__fromPtr__(ml_DTrees_load_10(filepath, nodeName));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: DTrees::load(filepath)
- public static DTrees load (string filepath)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- DTrees retVal = DTrees.__fromPtr__(ml_DTrees_load_11(filepath));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: bool cv::ml::DTrees::getTruncatePrunedTree()
- //
- //javadoc: DTrees::getTruncatePrunedTree()
- public bool getTruncatePrunedTree ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = ml_DTrees_getTruncatePrunedTree_10(nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: bool cv::ml::DTrees::getUse1SERule()
- //
- //javadoc: DTrees::getUse1SERule()
- public bool getUse1SERule ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = ml_DTrees_getUse1SERule_10(nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: bool cv::ml::DTrees::getUseSurrogates()
- //
- //javadoc: DTrees::getUseSurrogates()
- public bool getUseSurrogates ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = ml_DTrees_getUseSurrogates_10(nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: float cv::ml::DTrees::getRegressionAccuracy()
- //
- //javadoc: DTrees::getRegressionAccuracy()
- public float getRegressionAccuracy ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- float retVal = ml_DTrees_getRegressionAccuracy_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::ml::DTrees::getCVFolds()
- //
- //javadoc: DTrees::getCVFolds()
- public int getCVFolds ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ml_DTrees_getCVFolds_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::ml::DTrees::getMaxCategories()
- //
- //javadoc: DTrees::getMaxCategories()
- public int getMaxCategories ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ml_DTrees_getMaxCategories_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::ml::DTrees::getMaxDepth()
- //
- //javadoc: DTrees::getMaxDepth()
- public int getMaxDepth ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ml_DTrees_getMaxDepth_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::ml::DTrees::getMinSampleCount()
- //
- //javadoc: DTrees::getMinSampleCount()
- public int getMinSampleCount ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ml_DTrees_getMinSampleCount_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setCVFolds(int val)
- //
- //javadoc: DTrees::setCVFolds(val)
- public void setCVFolds (int val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setCVFolds_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setMaxCategories(int val)
- //
- //javadoc: DTrees::setMaxCategories(val)
- public void setMaxCategories (int val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setMaxCategories_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setMaxDepth(int val)
- //
- //javadoc: DTrees::setMaxDepth(val)
- public void setMaxDepth (int val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setMaxDepth_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setMinSampleCount(int val)
- //
- //javadoc: DTrees::setMinSampleCount(val)
- public void setMinSampleCount (int val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setMinSampleCount_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setPriors(Mat val)
- //
- //javadoc: DTrees::setPriors(val)
- public void setPriors (Mat val)
- {
- ThrowIfDisposed ();
- if (val != null) val.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setPriors_10(nativeObj, val.nativeObj);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setRegressionAccuracy(float val)
- //
- //javadoc: DTrees::setRegressionAccuracy(val)
- public void setRegressionAccuracy (float val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setRegressionAccuracy_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setTruncatePrunedTree(bool val)
- //
- //javadoc: DTrees::setTruncatePrunedTree(val)
- public void setTruncatePrunedTree (bool val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setTruncatePrunedTree_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setUse1SERule(bool val)
- //
- //javadoc: DTrees::setUse1SERule(val)
- public void setUse1SERule (bool val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setUse1SERule_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ml::DTrees::setUseSurrogates(bool val)
- //
- //javadoc: DTrees::setUseSurrogates(val)
- public void setUseSurrogates (bool val)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ml_DTrees_setUseSurrogates_10(nativeObj, val);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: Mat cv::ml::DTrees::getPriors()
- [DllImport (LIBNAME)]
- private static extern IntPtr ml_DTrees_getPriors_10 (IntPtr nativeObj);
- // C++: static Ptr_DTrees cv::ml::DTrees::create()
- [DllImport (LIBNAME)]
- private static extern IntPtr ml_DTrees_create_10 ();
- // C++: static Ptr_DTrees cv::ml::DTrees::load(String filepath, String nodeName = String())
- [DllImport (LIBNAME)]
- private static extern IntPtr ml_DTrees_load_10 (string filepath, string nodeName);
- [DllImport (LIBNAME)]
- private static extern IntPtr ml_DTrees_load_11 (string filepath);
- // C++: bool cv::ml::DTrees::getTruncatePrunedTree()
- [DllImport (LIBNAME)]
- private static extern bool ml_DTrees_getTruncatePrunedTree_10 (IntPtr nativeObj);
- // C++: bool cv::ml::DTrees::getUse1SERule()
- [DllImport (LIBNAME)]
- private static extern bool ml_DTrees_getUse1SERule_10 (IntPtr nativeObj);
- // C++: bool cv::ml::DTrees::getUseSurrogates()
- [DllImport (LIBNAME)]
- private static extern bool ml_DTrees_getUseSurrogates_10 (IntPtr nativeObj);
- // C++: float cv::ml::DTrees::getRegressionAccuracy()
- [DllImport (LIBNAME)]
- private static extern float ml_DTrees_getRegressionAccuracy_10 (IntPtr nativeObj);
- // C++: int cv::ml::DTrees::getCVFolds()
- [DllImport (LIBNAME)]
- private static extern int ml_DTrees_getCVFolds_10 (IntPtr nativeObj);
- // C++: int cv::ml::DTrees::getMaxCategories()
- [DllImport (LIBNAME)]
- private static extern int ml_DTrees_getMaxCategories_10 (IntPtr nativeObj);
- // C++: int cv::ml::DTrees::getMaxDepth()
- [DllImport (LIBNAME)]
- private static extern int ml_DTrees_getMaxDepth_10 (IntPtr nativeObj);
- // C++: int cv::ml::DTrees::getMinSampleCount()
- [DllImport (LIBNAME)]
- private static extern int ml_DTrees_getMinSampleCount_10 (IntPtr nativeObj);
- // C++: void cv::ml::DTrees::setCVFolds(int val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setCVFolds_10 (IntPtr nativeObj, int val);
- // C++: void cv::ml::DTrees::setMaxCategories(int val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setMaxCategories_10 (IntPtr nativeObj, int val);
- // C++: void cv::ml::DTrees::setMaxDepth(int val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setMaxDepth_10 (IntPtr nativeObj, int val);
- // C++: void cv::ml::DTrees::setMinSampleCount(int val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setMinSampleCount_10 (IntPtr nativeObj, int val);
- // C++: void cv::ml::DTrees::setPriors(Mat val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setPriors_10 (IntPtr nativeObj, IntPtr val_nativeObj);
- // C++: void cv::ml::DTrees::setRegressionAccuracy(float val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setRegressionAccuracy_10 (IntPtr nativeObj, float val);
- // C++: void cv::ml::DTrees::setTruncatePrunedTree(bool val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setTruncatePrunedTree_10 (IntPtr nativeObj, bool val);
- // C++: void cv::ml::DTrees::setUse1SERule(bool val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setUse1SERule_10 (IntPtr nativeObj, bool val);
- // C++: void cv::ml::DTrees::setUseSurrogates(bool val)
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_setUseSurrogates_10 (IntPtr nativeObj, bool val);
- // native support for java finalize()
- [DllImport (LIBNAME)]
- private static extern void ml_DTrees_delete (IntPtr nativeObj);
- }
- }
|