namespace cv
{
- template<> void Ptr<CvBGStatModel>::delete_obj()
+ template<> void DefaultDeleter<CvBGStatModel>::operator ()(CvBGStatModel* obj) const
{
cvReleaseBGStatModel(&obj);
}
Ptr<gpu::BackgroundSubtractorFGD> cv::gpu::createBackgroundSubtractorFGD(const FGDParams& params)
{
- return new FGDImpl(params);
+ return makePtr<FGDImpl>(params);
}
#endif // HAVE_CUDA
Ptr<gpu::BackgroundSubtractorGMG> cv::gpu::createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold)
{
- return new GMGImpl(initializationFrames, decisionThreshold);
+ return makePtr<GMGImpl>(initializationFrames, decisionThreshold);
}
#endif
Ptr<gpu::BackgroundSubtractorMOG> cv::gpu::createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma)
{
- return new MOGImpl(history, nmixtures, backgroundRatio, noiseSigma);
+ return makePtr<MOGImpl>(history, nmixtures, backgroundRatio, noiseSigma);
}
#endif
Ptr<gpu::BackgroundSubtractorMOG2> cv::gpu::createBackgroundSubtractorMOG2(int history, double varThreshold, bool detectShadows)
{
- return new MOG2Impl(history, varThreshold, detectShadows);
+ return makePtr<MOG2Impl>(history, varThreshold, detectShadows);
}
#endif
namespace cv
{
- template<> void Ptr<CvBGStatModel>::delete_obj()
+ template<> void DefaultDeleter<CvBGStatModel>::operator ()(CvBGStatModel* obj) const
{
cvReleaseBGStatModel(&obj);
}