From f0b050fa887762e333081b8741e633b4efad2cc0 Mon Sep 17 00:00:00 2001 From: Alexander Mordvintsev Date: Thu, 19 Sep 2013 18:41:08 +0400 Subject: [PATCH] exposed LineSegemntDetector to python --- modules/imgproc/include/opencv2/imgproc.hpp | 10 +++++----- modules/python/src2/cv2.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 3b25719..62d5a83 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -900,7 +900,7 @@ protected: Point2f bottomRight; }; -class LineSegmentDetector : public Algorithm +class CV_EXPORTS_W LineSegmentDetector : public Algorithm { public: /** @@ -922,7 +922,7 @@ public: * * 1 corresponds to 0.1 mean false alarms * This vector will be calculated _only_ when the objects type is REFINE_ADV */ - virtual void detect(InputArray _image, OutputArray _lines, + CV_WRAP virtual void detect(InputArray _image, OutputArray _lines, OutputArray width = noArray(), OutputArray prec = noArray(), OutputArray nfa = noArray()) = 0; @@ -933,7 +933,7 @@ public: * Should have the size of the image, where the lines were found * @param lines The lines that need to be drawn */ - virtual void drawSegments(InputOutputArray _image, InputArray lines) = 0; + CV_WRAP virtual void drawSegments(InputOutputArray _image, InputArray lines) = 0; /** * Draw both vectors on the image canvas. Uses blue for lines 1 and red for lines 2. @@ -945,13 +945,13 @@ public: * Should have the size of the image, where the lines were found * @return The number of mismatching pixels between lines1 and lines2. */ - virtual int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()) = 0; + CV_WRAP virtual int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()) = 0; virtual ~LineSegmentDetector() {}; }; //! Returns a pointer to a LineSegmentDetector class. -CV_EXPORTS Ptr createLineSegmentDetectorPtr( +CV_EXPORTS_W Ptr createLineSegmentDetectorPtr( int _refine = LSD_REFINE_STD, double _scale = 0.8, double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024); diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index b2bd368..f404c06 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -137,7 +137,8 @@ typedef Ptr Ptr_StereoSGBM; typedef Ptr Ptr_ChannelFeatureBuilder; typedef Ptr Ptr_CLAHE; - +typedef Ptr Ptr_LineSegmentDetector; + typedef SimpleBlobDetector::Params SimpleBlobDetector_Params; typedef cvflann::flann_distance_t cvflann_flann_distance_t; -- 2.7.4