diff --git a/modules/ximgproc/include/opencv2/ximgproc/structured_edge_detection.hpp b/modules/ximgproc/include/opencv2/ximgproc/structured_edge_detection.hpp index 23f0af7e1..3763b4472 100644 --- a/modules/ximgproc/include/opencv2/ximgproc/structured_edge_detection.hpp +++ b/modules/ximgproc/include/opencv2/ximgproc/structured_edge_detection.hpp @@ -107,7 +107,7 @@ public: * \param dst : destination image (grayscale, float, in [0;1]) * where edges are drawn */ - CV_WRAP virtual void detectEdges(const Mat &src, Mat &dst) const = 0; + CV_WRAP virtual void detectEdges(const Mat &src, CV_OUT Mat &dst) const = 0; }; /*! @@ -119,7 +119,7 @@ public: * own forest, pass NULL otherwise */ CV_EXPORTS_W Ptr createStructuredEdgeDetection(const String &model, - const RFFeatureGetter *howToGetFeatures = NULL); + Ptr howToGetFeatures = Ptr()); } } diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index 3d7a28b3e..befc6dc2e 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -339,11 +339,11 @@ public: * \param filename : name of the file where the model is stored */ StructuredEdgeDetectionImpl(const cv::String &filename, - const RFFeatureGetter *_howToGetFeatures) + Ptr _howToGetFeatures) : name("StructuredEdgeDetection"), - howToGetFeatures( _howToGetFeatures != NULL + howToGetFeatures( (!_howToGetFeatures.empty()) ? _howToGetFeatures - : createRFFeatureGetter() ) + : createRFFeatureGetter().staticCast() ) { cv::FileStorage modelFile(filename, FileStorage::READ); CV_Assert( modelFile.isOpened() ); @@ -631,7 +631,7 @@ protected: String name; /*! optional feature getter (getFeatures method) */ - const RFFeatureGetter *howToGetFeatures; + Ptr howToGetFeatures; /*! random forest used to detect edges */ struct RandomForest @@ -684,7 +684,7 @@ protected: }; Ptr createStructuredEdgeDetection(const String &model, - const RFFeatureGetter *howToGetFeatures) + Ptr howToGetFeatures) { return makePtr(model, howToGetFeatures); }