123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.MlModule {
- // C++: class NormalBayesClassifier
- //javadoc: NormalBayesClassifier
- public class NormalBayesClassifier : StatModel {
- protected override void Dispose(bool disposing) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- try {
- if (disposing) {
- }
- if (IsEnabledDispose) {
- if (nativeObj != IntPtr.Zero)
- ml_NormalBayesClassifier_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose(disposing);
- }
- #else
- return;
- #endif
- }
- protected internal NormalBayesClassifier(IntPtr addr) : base(addr) { }
- // internal usage only
- public static new NormalBayesClassifier __fromPtr__(IntPtr addr) { return new NormalBayesClassifier(addr); }
- //
- // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create()
- //
- //javadoc: NormalBayesClassifier::create()
- public static NormalBayesClassifier create() {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(ml_NormalBayesClassifier_create_10());
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String())
- //
- //javadoc: NormalBayesClassifier::load(filepath, nodeName)
- public static NormalBayesClassifier load(string filepath, string nodeName) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(ml_NormalBayesClassifier_load_10(filepath, nodeName));
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: NormalBayesClassifier::load(filepath)
- public static NormalBayesClassifier load(string filepath) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(ml_NormalBayesClassifier_load_11(filepath));
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0)
- //
- //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs, flags)
- public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) {
- ThrowIfDisposed();
- if (inputs != null) inputs.ThrowIfDisposed();
- if (outputs != null) outputs.ThrowIfDisposed();
- if (outputProbs != null) outputProbs.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- float retVal = ml_NormalBayesClassifier_predictProb_10(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags);
- return retVal;
- #else
- return -1;
- #endif
- }
- //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs)
- public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) {
- ThrowIfDisposed();
- if (inputs != null) inputs.ThrowIfDisposed();
- if (outputs != null) outputs.ThrowIfDisposed();
- if (outputProbs != null) outputProbs.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- float retVal = ml_NormalBayesClassifier_predictProb_11(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj);
- return retVal;
- #else
- return -1;
- #endif
- }
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- const string LIBNAME = "opencvforunity";
- // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create()
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_NormalBayesClassifier_create_10();
- // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String())
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_NormalBayesClassifier_load_10(string filepath, string nodeName);
- [DllImport(LIBNAME)]
- private static extern IntPtr ml_NormalBayesClassifier_load_11(string filepath);
- // C++: float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0)
- [DllImport(LIBNAME)]
- private static extern float ml_NormalBayesClassifier_predictProb_10(IntPtr nativeObj, IntPtr inputs_nativeObj, IntPtr outputs_nativeObj, IntPtr outputProbs_nativeObj, int flags);
- [DllImport(LIBNAME)]
- private static extern float ml_NormalBayesClassifier_predictProb_11(IntPtr nativeObj, IntPtr inputs_nativeObj, IntPtr outputs_nativeObj, IntPtr outputProbs_nativeObj);
- // native support for java finalize()
- [DllImport(LIBNAME)]
- private static extern void ml_NormalBayesClassifier_delete(IntPtr nativeObj);
- #endif
- }
- }
|