Commit 71c98af0 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #80 from znah/py_wrap

StructuredEdgeDetection to python
parents 5e70cd85 96efa4cd
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
* \param dst : destination image (grayscale, float, in [0;1]) * \param dst : destination image (grayscale, float, in [0;1])
* where edges are drawn * 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: ...@@ -119,7 +119,7 @@ public:
* own forest, pass NULL otherwise * own forest, pass NULL otherwise
*/ */
CV_EXPORTS_W Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model, CV_EXPORTS_W Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model,
const RFFeatureGetter *howToGetFeatures = NULL); Ptr<const RFFeatureGetter> howToGetFeatures = Ptr<RFFeatureGetter>());
} }
} }
......
...@@ -339,11 +339,11 @@ public: ...@@ -339,11 +339,11 @@ public:
* \param filename : name of the file where the model is stored * \param filename : name of the file where the model is stored
*/ */
StructuredEdgeDetectionImpl(const cv::String &filename, StructuredEdgeDetectionImpl(const cv::String &filename,
const RFFeatureGetter *_howToGetFeatures) Ptr<const RFFeatureGetter> _howToGetFeatures)
: name("StructuredEdgeDetection"), : name("StructuredEdgeDetection"),
howToGetFeatures( _howToGetFeatures != NULL howToGetFeatures( (!_howToGetFeatures.empty())
? _howToGetFeatures ? _howToGetFeatures
: createRFFeatureGetter() ) : createRFFeatureGetter().staticCast<const RFFeatureGetter>() )
{ {
cv::FileStorage modelFile(filename, FileStorage::READ); cv::FileStorage modelFile(filename, FileStorage::READ);
CV_Assert( modelFile.isOpened() ); CV_Assert( modelFile.isOpened() );
...@@ -631,7 +631,7 @@ protected: ...@@ -631,7 +631,7 @@ protected:
String name; String name;
/*! optional feature getter (getFeatures method) */ /*! optional feature getter (getFeatures method) */
const RFFeatureGetter *howToGetFeatures; Ptr<const RFFeatureGetter> howToGetFeatures;
/*! random forest used to detect edges */ /*! random forest used to detect edges */
struct RandomForest struct RandomForest
...@@ -684,7 +684,7 @@ protected: ...@@ -684,7 +684,7 @@ protected:
}; };
Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model, Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model,
const RFFeatureGetter *howToGetFeatures) Ptr<const RFFeatureGetter> howToGetFeatures)
{ {
return makePtr<StructuredEdgeDetectionImpl>(model, howToGetFeatures); return makePtr<StructuredEdgeDetectionImpl>(model, howToGetFeatures);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment