123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.Features2dModule
- {
-
-
- public class KAZE : Feature2D
- {
- 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)
- features2d_KAZE_delete (nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal KAZE (IntPtr addr)
- : base (addr)
- {
- }
-
- public static new KAZE __fromPtr__ (IntPtr addr)
- {
- return new KAZE (addr);
- }
-
- public const int DIFF_PM_G1 = 0;
- public const int DIFF_PM_G2 = 1;
- public const int DIFF_WEICKERT = 2;
- public const int DIFF_CHARBONNIER = 3;
-
-
-
-
- public int getDiffusivity ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_KAZE_getDiffusivity_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
-
-
-
-
- public static KAZE create (bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers, int diffusivity)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_10 (extended, upright, threshold, nOctaves, nOctaveLayers, diffusivity));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create (bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_11 (extended, upright, threshold, nOctaves, nOctaveLayers));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create (bool extended, bool upright, float threshold, int nOctaves)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_12 (extended, upright, threshold, nOctaves));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create (bool extended, bool upright, float threshold)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_13 (extended, upright, threshold));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create (bool extended, bool upright)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_14 (extended, upright));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create (bool extended)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_15 (extended));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
- public static KAZE create ()
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- KAZE retVal = KAZE.__fromPtr__ (features2d_KAZE_create_16 ());
-
- return retVal;
- #else
- return null;
- #endif
- }
-
-
-
-
- public override string getDefaultName ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (features2d_KAZE_getDefaultName_10 (nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
-
-
-
-
- public bool getExtended ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = features2d_KAZE_getExtended_10 (nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
-
-
-
-
- public bool getUpright ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = features2d_KAZE_getUpright_10 (nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
-
-
-
-
- public double getThreshold ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- double retVal = features2d_KAZE_getThreshold_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
-
-
-
-
- public int getNOctaveLayers ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_KAZE_getNOctaveLayers_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
-
-
-
-
- public int getNOctaves ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_KAZE_getNOctaves_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
-
-
-
-
- public void setDiffusivity (int diff)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setDiffusivity_10 (nativeObj, diff);
-
- return;
- #else
- return;
- #endif
- }
-
-
-
-
- public void setExtended (bool extended)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setExtended_10 (nativeObj, extended);
-
- return;
- #else
- return;
- #endif
- }
-
-
-
-
- public void setNOctaveLayers (int octaveLayers)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setNOctaveLayers_10 (nativeObj, octaveLayers);
-
- return;
- #else
- return;
- #endif
- }
-
-
-
-
- public void setNOctaves (int octaves)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setNOctaves_10 (nativeObj, octaves);
-
- return;
- #else
- return;
- #endif
- }
-
-
-
-
- public void setThreshold (double threshold)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setThreshold_10 (nativeObj, threshold);
-
- return;
- #else
- return;
- #endif
- }
-
-
-
-
- public void setUpright (bool upright)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_KAZE_setUpright_10 (nativeObj, upright);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
-
- #else
- const string LIBNAME = "opencvforunity";
- #endif
-
- [DllImport (LIBNAME)]
- private static extern int features2d_KAZE_getDiffusivity_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_10 (bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers, int diffusivity);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_11 (bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_12 (bool extended, bool upright, float threshold, int nOctaves);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_13 (bool extended, bool upright, float threshold);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_14 (bool extended, bool upright);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_15 (bool extended);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_create_16 ();
-
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_KAZE_getDefaultName_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern bool features2d_KAZE_getExtended_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern bool features2d_KAZE_getUpright_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern double features2d_KAZE_getThreshold_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern int features2d_KAZE_getNOctaveLayers_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern int features2d_KAZE_getNOctaves_10 (IntPtr nativeObj);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setDiffusivity_10 (IntPtr nativeObj, int diff);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setExtended_10 (IntPtr nativeObj, bool extended);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setNOctaveLayers_10 (IntPtr nativeObj, int octaveLayers);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setNOctaves_10 (IntPtr nativeObj, int octaves);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setThreshold_10 (IntPtr nativeObj, double threshold);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_setUpright_10 (IntPtr nativeObj, bool upright);
-
- [DllImport (LIBNAME)]
- private static extern void features2d_KAZE_delete (IntPtr nativeObj);
- }
- }
|