123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.XimgprocModule
- {
- // C++: class ContourFitting
- //javadoc: ContourFitting
- public class ContourFitting : Algorithm
- {
- 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)
- ximgproc_ContourFitting_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal ContourFitting (IntPtr addr) : base (addr) { }
- // internal usage only
- public static new ContourFitting __fromPtr__ (IntPtr addr) { return new ContourFitting (addr); }
- //
- // C++: int cv::ximgproc::ContourFitting::getCtrSize()
- //
- //javadoc: ContourFitting::getCtrSize()
- public int getCtrSize ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ximgproc_ContourFitting_getCtrSize_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::ximgproc::ContourFitting::getFDSize()
- //
- //javadoc: ContourFitting::getFDSize()
- public int getFDSize ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = ximgproc_ContourFitting_getFDSize_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void cv::ximgproc::ContourFitting::estimateTransformation(Mat src, Mat dst, Mat& alphaPhiST, double& dist, bool fdContour = false)
- //
- //javadoc: ContourFitting::estimateTransformation(src, dst, alphaPhiST, dist, fdContour)
- public void estimateTransformation (Mat src, Mat dst, Mat alphaPhiST, double[] dist, bool fdContour)
- {
- ThrowIfDisposed ();
- if (src != null) src.ThrowIfDisposed ();
- if (dst != null) dst.ThrowIfDisposed ();
- if (alphaPhiST != null) alphaPhiST.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
- double[] dist_out = new double[1];
- ximgproc_ContourFitting_estimateTransformation_10(nativeObj, src.nativeObj, dst.nativeObj, alphaPhiST.nativeObj, dist_out, fdContour);
- if(dist!=null) dist[0] = (double)dist_out[0];
- return;
- #else
- return;
- #endif
- }
- //javadoc: ContourFitting::estimateTransformation(src, dst, alphaPhiST, dist)
- public void estimateTransformation (Mat src, Mat dst, Mat alphaPhiST, double[] dist)
- {
- ThrowIfDisposed ();
- if (src != null) src.ThrowIfDisposed ();
- if (dst != null) dst.ThrowIfDisposed ();
- if (alphaPhiST != null) alphaPhiST.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
- double[] dist_out = new double[1];
- ximgproc_ContourFitting_estimateTransformation_11(nativeObj, src.nativeObj, dst.nativeObj, alphaPhiST.nativeObj, dist_out);
- if(dist!=null) dist[0] = (double)dist_out[0];
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ximgproc::ContourFitting::setCtrSize(int n)
- //
- //javadoc: ContourFitting::setCtrSize(n)
- public void setCtrSize (int n)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ximgproc_ContourFitting_setCtrSize_10(nativeObj, n);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::ximgproc::ContourFitting::setFDSize(int n)
- //
- //javadoc: ContourFitting::setFDSize(n)
- public void setFDSize (int n)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- ximgproc_ContourFitting_setFDSize_10(nativeObj, n);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: int cv::ximgproc::ContourFitting::getCtrSize()
- [DllImport (LIBNAME)]
- private static extern int ximgproc_ContourFitting_getCtrSize_10 (IntPtr nativeObj);
- // C++: int cv::ximgproc::ContourFitting::getFDSize()
- [DllImport (LIBNAME)]
- private static extern int ximgproc_ContourFitting_getFDSize_10 (IntPtr nativeObj);
- // C++: void cv::ximgproc::ContourFitting::estimateTransformation(Mat src, Mat dst, Mat& alphaPhiST, double& dist, bool fdContour = false)
- [DllImport (LIBNAME)]
- private static extern void ximgproc_ContourFitting_estimateTransformation_10 (IntPtr nativeObj, IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr alphaPhiST_nativeObj, double[] dist_out, bool fdContour);
- [DllImport (LIBNAME)]
- private static extern void ximgproc_ContourFitting_estimateTransformation_11 (IntPtr nativeObj, IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr alphaPhiST_nativeObj, double[] dist_out);
- // C++: void cv::ximgproc::ContourFitting::setCtrSize(int n)
- [DllImport (LIBNAME)]
- private static extern void ximgproc_ContourFitting_setCtrSize_10 (IntPtr nativeObj, int n);
- // C++: void cv::ximgproc::ContourFitting::setFDSize(int n)
- [DllImport (LIBNAME)]
- private static extern void ximgproc_ContourFitting_setFDSize_10 (IntPtr nativeObj, int n);
- // native support for java finalize()
- [DllImport (LIBNAME)]
- private static extern void ximgproc_ContourFitting_delete (IntPtr nativeObj);
- }
- }
|