123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.Features2dModule
- {
- // C++: class MSER
- //javadoc: MSER
- public class MSER : 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_MSER_delete (nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal MSER (IntPtr addr)
- : base (addr)
- {
- }
- // internal usage only
- public static new MSER __fromPtr__ (IntPtr addr)
- {
- return new MSER (addr);
- }
- //
- // C++: static Ptr_MSER cv::MSER::create(int _delta = 5, int _min_area = 60, int _max_area = 14400, double _max_variation = 0.25, double _min_diversity = .2, int _max_evolution = 200, double _area_threshold = 1.01, double _min_margin = 0.003, int _edge_blur_size = 5)
- //
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold, double _min_margin, int _edge_blur_size)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_10 (_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold, double _min_margin)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_11 (_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_12 (_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_13 (_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation, _min_diversity)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_14 (_delta, _min_area, _max_area, _max_variation, _min_diversity));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area, _max_variation)
- public static MSER create (int _delta, int _min_area, int _max_area, double _max_variation)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_15 (_delta, _min_area, _max_area, _max_variation));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area, _max_area)
- public static MSER create (int _delta, int _min_area, int _max_area)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_16 (_delta, _min_area, _max_area));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta, _min_area)
- public static MSER create (int _delta, int _min_area)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_17 (_delta, _min_area));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create(_delta)
- public static MSER create (int _delta)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_18 (_delta));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: MSER::create()
- public static MSER create ()
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- MSER retVal = MSER.__fromPtr__ (features2d_MSER_create_19 ());
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: String cv::MSER::getDefaultName()
- //
- //javadoc: MSER::getDefaultName()
- 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_MSER_getDefaultName_10 (nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: bool cv::MSER::getPass2Only()
- //
- //javadoc: MSER::getPass2Only()
- public bool getPass2Only ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = features2d_MSER_getPass2Only_10 (nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: int cv::MSER::getDelta()
- //
- //javadoc: MSER::getDelta()
- public int getDelta ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_MSER_getDelta_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::MSER::getMaxArea()
- //
- //javadoc: MSER::getMaxArea()
- public int getMaxArea ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_MSER_getMaxArea_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::MSER::getMinArea()
- //
- //javadoc: MSER::getMinArea()
- public int getMinArea ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = features2d_MSER_getMinArea_10 (nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void cv::MSER::detectRegions(Mat image, vector_vector_Point& msers, vector_Rect& bboxes)
- //
- //javadoc: MSER::detectRegions(image, msers, bboxes)
- public void detectRegions (Mat image, List<MatOfPoint> msers, MatOfRect bboxes)
- {
- ThrowIfDisposed ();
- if (image != null)
- image.ThrowIfDisposed ();
- if (bboxes != null)
- bboxes.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
- Mat msers_mat = new Mat ();
- Mat bboxes_mat = bboxes;
- features2d_MSER_detectRegions_10 (nativeObj, image.nativeObj, msers_mat.nativeObj, bboxes_mat.nativeObj);
- Converters.Mat_to_vector_vector_Point (msers_mat, msers);
- msers_mat.release ();
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::MSER::setDelta(int delta)
- //
- //javadoc: MSER::setDelta(delta)
- public void setDelta (int delta)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_MSER_setDelta_10 (nativeObj, delta);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::MSER::setMaxArea(int maxArea)
- //
- //javadoc: MSER::setMaxArea(maxArea)
- public void setMaxArea (int maxArea)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_MSER_setMaxArea_10 (nativeObj, maxArea);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::MSER::setMinArea(int minArea)
- //
- //javadoc: MSER::setMinArea(minArea)
- public void setMinArea (int minArea)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_MSER_setMinArea_10 (nativeObj, minArea);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::MSER::setPass2Only(bool f)
- //
- //javadoc: MSER::setPass2Only(f)
- public void setPass2Only (bool f)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- features2d_MSER_setPass2Only_10 (nativeObj, f);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
-
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: static Ptr_MSER cv::MSER::create(int _delta = 5, int _min_area = 60, int _max_area = 14400, double _max_variation = 0.25, double _min_diversity = .2, int _max_evolution = 200, double _area_threshold = 1.01, double _min_margin = 0.003, int _edge_blur_size = 5)
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_10 (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold, double _min_margin, int _edge_blur_size);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_11 (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold, double _min_margin);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_12 (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution, double _area_threshold);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_13 (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity, int _max_evolution);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_14 (int _delta, int _min_area, int _max_area, double _max_variation, double _min_diversity);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_15 (int _delta, int _min_area, int _max_area, double _max_variation);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_16 (int _delta, int _min_area, int _max_area);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_17 (int _delta, int _min_area);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_18 (int _delta);
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_create_19 ();
- // C++: String cv::MSER::getDefaultName()
- [DllImport (LIBNAME)]
- private static extern IntPtr features2d_MSER_getDefaultName_10 (IntPtr nativeObj);
- // C++: bool cv::MSER::getPass2Only()
- [DllImport (LIBNAME)]
- private static extern bool features2d_MSER_getPass2Only_10 (IntPtr nativeObj);
- // C++: int cv::MSER::getDelta()
- [DllImport (LIBNAME)]
- private static extern int features2d_MSER_getDelta_10 (IntPtr nativeObj);
- // C++: int cv::MSER::getMaxArea()
- [DllImport (LIBNAME)]
- private static extern int features2d_MSER_getMaxArea_10 (IntPtr nativeObj);
- // C++: int cv::MSER::getMinArea()
- [DllImport (LIBNAME)]
- private static extern int features2d_MSER_getMinArea_10 (IntPtr nativeObj);
- // C++: void cv::MSER::detectRegions(Mat image, vector_vector_Point& msers, vector_Rect& bboxes)
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_detectRegions_10 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr msers_mat_nativeObj, IntPtr bboxes_mat_nativeObj);
- // C++: void cv::MSER::setDelta(int delta)
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_setDelta_10 (IntPtr nativeObj, int delta);
- // C++: void cv::MSER::setMaxArea(int maxArea)
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_setMaxArea_10 (IntPtr nativeObj, int maxArea);
- // C++: void cv::MSER::setMinArea(int minArea)
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_setMinArea_10 (IntPtr nativeObj, int minArea);
- // C++: void cv::MSER::setPass2Only(bool f)
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_setPass2Only_10 (IntPtr nativeObj, bool f);
- // native support for java finalize()
- [DllImport (LIBNAME)]
- private static extern void features2d_MSER_delete (IntPtr nativeObj);
- }
- }
|