cv::Mat class member

asked 2018-09-05 17:12:00 -0500

2ros0 gravatar image

Hi,

I'm curious as to whether a cv::Mat class member is usually wrapped in a boost::shared_ptr is considered best practice?

I have seen this being used in a few places. If yes, then what are the advantages, specifically when considering if cv::Mat is used in vision/perception applications.

Thanks

edit retag flag offensive close merge delete

Comments

1

cv::Mat is already a refcounted smartpointer, so using pointers to that will inevitably defeat its purpose and lead to memleaks.

also, opencv has cv::Ptr and there is std::shared_ptr so no need for boost at all.

berak gravatar imageberak ( 2018-09-06 00:16:39 -0500 )edit