c++ - OpenCV: How to pass cv::Ptr as argument? -
c++ - OpenCV: How to pass cv::Ptr as argument? -
i need pass cv::ptr
argument function , not sure how it. shall pass reference, or value? know std::auto_ptr
pretty ugly if pass value , not reference.
so:
void foo(cv::ptr<cv::featuredetector> detector) { /*...*/ }
or
void foo(cv::ptr<cv::featuredetector>& detector) { /*...*/ }
?
and, if utilize const
, difference:
void foo(const cv::ptr<cv::featuredetector> detector) { /*...*/ } void foo(const cv::ptr<cv::featuredetector>& detector) { /*...*/ }
?
cv::ptr
object. see other related questions , answers this: how pass objects functions in c++?
c++ opencv
Comments
Post a Comment