@@ -339,11 +339,11 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
339339 * \param filename : name of the file where the model is stored
340340 */
341341 StructuredEdgeDetectionImpl (const cv::String &filename,
342- const RFFeatureGetter * _howToGetFeatures)
342+ Ptr< const RFFeatureGetter> _howToGetFeatures)
343343 : name(" StructuredEdgeDetection" ),
344- howToGetFeatures ( _howToGetFeatures != NULL
344+ howToGetFeatures ( (!_howToGetFeatures.empty())
345345 ? _howToGetFeatures
346- : createRFFeatureGetter() )
346+ : createRFFeatureGetter().staticCast< const RFFeatureGetter>() )
347347 {
348348 cv::FileStorage modelFile (filename, FileStorage::READ);
349349 CV_Assert ( modelFile.isOpened () );
@@ -631,7 +631,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
631631 String name;
632632
633633 /* ! optional feature getter (getFeatures method) */
634- const RFFeatureGetter * howToGetFeatures;
634+ Ptr< const RFFeatureGetter> howToGetFeatures;
635635
636636 /* ! random forest used to detect edges */
637637 struct RandomForest
@@ -684,7 +684,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
684684};
685685
686686Ptr<StructuredEdgeDetection> createStructuredEdgeDetection (const String &model,
687- const RFFeatureGetter * howToGetFeatures)
687+ Ptr< const RFFeatureGetter> howToGetFeatures)
688688{
689689 return makePtr<StructuredEdgeDetectionImpl>(model, howToGetFeatures);
690690}
0 commit comments