123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.ImgprocModule
- {
- // C++: class GeneralizedHough
- /**
- * finds arbitrary template in the grayscale image using Generalized Hough Transform
- */
- public class GeneralizedHough : Algorithm
- {
- protected override void Dispose(bool disposing)
- {
- try
- {
- if (disposing)
- {
- }
- if (IsEnabledDispose)
- {
- if (nativeObj != IntPtr.Zero)
- imgproc_GeneralizedHough_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- }
- finally
- {
- base.Dispose(disposing);
- }
- }
- protected internal GeneralizedHough(IntPtr addr) : base(addr) { }
- // internal usage only
- public static new GeneralizedHough __fromPtr__(IntPtr addr) { return new GeneralizedHough(addr); }
- //
- // C++: void cv::GeneralizedHough::setTemplate(Mat templ, Point templCenter = Point(-1, -1))
- //
- public void setTemplate(Mat templ, Point templCenter)
- {
- ThrowIfDisposed();
- if (templ != null) templ.ThrowIfDisposed();
- imgproc_GeneralizedHough_setTemplate_10(nativeObj, templ.nativeObj, templCenter.x, templCenter.y);
- }
- public void setTemplate(Mat templ)
- {
- ThrowIfDisposed();
- if (templ != null) templ.ThrowIfDisposed();
- imgproc_GeneralizedHough_setTemplate_11(nativeObj, templ.nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setTemplate(Mat edges, Mat dx, Mat dy, Point templCenter = Point(-1, -1))
- //
- public void setTemplate(Mat edges, Mat dx, Mat dy, Point templCenter)
- {
- ThrowIfDisposed();
- if (edges != null) edges.ThrowIfDisposed();
- if (dx != null) dx.ThrowIfDisposed();
- if (dy != null) dy.ThrowIfDisposed();
- imgproc_GeneralizedHough_setTemplate_12(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, templCenter.x, templCenter.y);
- }
- public void setTemplate(Mat edges, Mat dx, Mat dy)
- {
- ThrowIfDisposed();
- if (edges != null) edges.ThrowIfDisposed();
- if (dx != null) dx.ThrowIfDisposed();
- if (dy != null) dy.ThrowIfDisposed();
- imgproc_GeneralizedHough_setTemplate_13(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::detect(Mat image, Mat& positions, Mat& votes = Mat())
- //
- public void detect(Mat image, Mat positions, Mat votes)
- {
- ThrowIfDisposed();
- if (image != null) image.ThrowIfDisposed();
- if (positions != null) positions.ThrowIfDisposed();
- if (votes != null) votes.ThrowIfDisposed();
- imgproc_GeneralizedHough_detect_10(nativeObj, image.nativeObj, positions.nativeObj, votes.nativeObj);
- }
- public void detect(Mat image, Mat positions)
- {
- ThrowIfDisposed();
- if (image != null) image.ThrowIfDisposed();
- if (positions != null) positions.ThrowIfDisposed();
- imgproc_GeneralizedHough_detect_11(nativeObj, image.nativeObj, positions.nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::detect(Mat edges, Mat dx, Mat dy, Mat& positions, Mat& votes = Mat())
- //
- public void detect(Mat edges, Mat dx, Mat dy, Mat positions, Mat votes)
- {
- ThrowIfDisposed();
- if (edges != null) edges.ThrowIfDisposed();
- if (dx != null) dx.ThrowIfDisposed();
- if (dy != null) dy.ThrowIfDisposed();
- if (positions != null) positions.ThrowIfDisposed();
- if (votes != null) votes.ThrowIfDisposed();
- imgproc_GeneralizedHough_detect_12(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, positions.nativeObj, votes.nativeObj);
- }
- public void detect(Mat edges, Mat dx, Mat dy, Mat positions)
- {
- ThrowIfDisposed();
- if (edges != null) edges.ThrowIfDisposed();
- if (dx != null) dx.ThrowIfDisposed();
- if (dy != null) dy.ThrowIfDisposed();
- if (positions != null) positions.ThrowIfDisposed();
- imgproc_GeneralizedHough_detect_13(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, positions.nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setCannyLowThresh(int cannyLowThresh)
- //
- public void setCannyLowThresh(int cannyLowThresh)
- {
- ThrowIfDisposed();
- imgproc_GeneralizedHough_setCannyLowThresh_10(nativeObj, cannyLowThresh);
- }
- //
- // C++: int cv::GeneralizedHough::getCannyLowThresh()
- //
- public int getCannyLowThresh()
- {
- ThrowIfDisposed();
- return imgproc_GeneralizedHough_getCannyLowThresh_10(nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setCannyHighThresh(int cannyHighThresh)
- //
- public void setCannyHighThresh(int cannyHighThresh)
- {
- ThrowIfDisposed();
- imgproc_GeneralizedHough_setCannyHighThresh_10(nativeObj, cannyHighThresh);
- }
- //
- // C++: int cv::GeneralizedHough::getCannyHighThresh()
- //
- public int getCannyHighThresh()
- {
- ThrowIfDisposed();
- return imgproc_GeneralizedHough_getCannyHighThresh_10(nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setMinDist(double minDist)
- //
- public void setMinDist(double minDist)
- {
- ThrowIfDisposed();
- imgproc_GeneralizedHough_setMinDist_10(nativeObj, minDist);
- }
- //
- // C++: double cv::GeneralizedHough::getMinDist()
- //
- public double getMinDist()
- {
- ThrowIfDisposed();
- return imgproc_GeneralizedHough_getMinDist_10(nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setDp(double dp)
- //
- public void setDp(double dp)
- {
- ThrowIfDisposed();
- imgproc_GeneralizedHough_setDp_10(nativeObj, dp);
- }
- //
- // C++: double cv::GeneralizedHough::getDp()
- //
- public double getDp()
- {
- ThrowIfDisposed();
- return imgproc_GeneralizedHough_getDp_10(nativeObj);
- }
- //
- // C++: void cv::GeneralizedHough::setMaxBufferSize(int maxBufferSize)
- //
- public void setMaxBufferSize(int maxBufferSize)
- {
- ThrowIfDisposed();
- imgproc_GeneralizedHough_setMaxBufferSize_10(nativeObj, maxBufferSize);
- }
- //
- // C++: int cv::GeneralizedHough::getMaxBufferSize()
- //
- public int getMaxBufferSize()
- {
- ThrowIfDisposed();
- return imgproc_GeneralizedHough_getMaxBufferSize_10(nativeObj);
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: void cv::GeneralizedHough::setTemplate(Mat templ, Point templCenter = Point(-1, -1))
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setTemplate_10(IntPtr nativeObj, IntPtr templ_nativeObj, double templCenter_x, double templCenter_y);
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setTemplate_11(IntPtr nativeObj, IntPtr templ_nativeObj);
- // C++: void cv::GeneralizedHough::setTemplate(Mat edges, Mat dx, Mat dy, Point templCenter = Point(-1, -1))
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setTemplate_12(IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, double templCenter_x, double templCenter_y);
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setTemplate_13(IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj);
- // C++: void cv::GeneralizedHough::detect(Mat image, Mat& positions, Mat& votes = Mat())
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_detect_10(IntPtr nativeObj, IntPtr image_nativeObj, IntPtr positions_nativeObj, IntPtr votes_nativeObj);
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_detect_11(IntPtr nativeObj, IntPtr image_nativeObj, IntPtr positions_nativeObj);
- // C++: void cv::GeneralizedHough::detect(Mat edges, Mat dx, Mat dy, Mat& positions, Mat& votes = Mat())
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_detect_12(IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, IntPtr positions_nativeObj, IntPtr votes_nativeObj);
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_detect_13(IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, IntPtr positions_nativeObj);
- // C++: void cv::GeneralizedHough::setCannyLowThresh(int cannyLowThresh)
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setCannyLowThresh_10(IntPtr nativeObj, int cannyLowThresh);
- // C++: int cv::GeneralizedHough::getCannyLowThresh()
- [DllImport(LIBNAME)]
- private static extern int imgproc_GeneralizedHough_getCannyLowThresh_10(IntPtr nativeObj);
- // C++: void cv::GeneralizedHough::setCannyHighThresh(int cannyHighThresh)
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setCannyHighThresh_10(IntPtr nativeObj, int cannyHighThresh);
- // C++: int cv::GeneralizedHough::getCannyHighThresh()
- [DllImport(LIBNAME)]
- private static extern int imgproc_GeneralizedHough_getCannyHighThresh_10(IntPtr nativeObj);
- // C++: void cv::GeneralizedHough::setMinDist(double minDist)
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setMinDist_10(IntPtr nativeObj, double minDist);
- // C++: double cv::GeneralizedHough::getMinDist()
- [DllImport(LIBNAME)]
- private static extern double imgproc_GeneralizedHough_getMinDist_10(IntPtr nativeObj);
- // C++: void cv::GeneralizedHough::setDp(double dp)
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setDp_10(IntPtr nativeObj, double dp);
- // C++: double cv::GeneralizedHough::getDp()
- [DllImport(LIBNAME)]
- private static extern double imgproc_GeneralizedHough_getDp_10(IntPtr nativeObj);
- // C++: void cv::GeneralizedHough::setMaxBufferSize(int maxBufferSize)
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_setMaxBufferSize_10(IntPtr nativeObj, int maxBufferSize);
- // C++: int cv::GeneralizedHough::getMaxBufferSize()
- [DllImport(LIBNAME)]
- private static extern int imgproc_GeneralizedHough_getMaxBufferSize_10(IntPtr nativeObj);
- // native support for java finalize()
- [DllImport(LIBNAME)]
- private static extern void imgproc_GeneralizedHough_delete(IntPtr nativeObj);
- }
- }
|