From 808e0cf10b43d566dbe38e92b16e6377cdbca460 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 13 Aug 2013 17:57:49 +0400 Subject: [PATCH] Boring changes - video. --- modules/video/src/bgfg_gaussmix.cpp | 2 +- modules/video/src/bgfg_gaussmix2.cpp | 2 +- modules/video/src/bgfg_gmg.cpp | 2 +- modules/video/src/tvl1flow.cpp | 2 +- modules/video/test/test_backgroundsubtractor_gbh.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/video/src/bgfg_gaussmix.cpp b/modules/video/src/bgfg_gaussmix.cpp index a1a224d973..b5ad039e27 100644 --- a/modules/video/src/bgfg_gaussmix.cpp +++ b/modules/video/src/bgfg_gaussmix.cpp @@ -464,7 +464,7 @@ void BackgroundSubtractorMOGImpl::apply(InputArray _image, OutputArray _fgmask, Ptr createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma) { - return new BackgroundSubtractorMOGImpl(history, nmixtures, backgroundRatio, noiseSigma); + return makePtr(history, nmixtures, backgroundRatio, noiseSigma); } } diff --git a/modules/video/src/bgfg_gaussmix2.cpp b/modules/video/src/bgfg_gaussmix2.cpp index 2c99c01b05..485e34d26d 100644 --- a/modules/video/src/bgfg_gaussmix2.cpp +++ b/modules/video/src/bgfg_gaussmix2.cpp @@ -769,7 +769,7 @@ void BackgroundSubtractorMOG2Impl::getBackgroundImage(OutputArray backgroundImag Ptr createBackgroundSubtractorMOG2(int _history, double _varThreshold, bool _bShadowDetection) { - return new BackgroundSubtractorMOG2Impl(_history, (float)_varThreshold, _bShadowDetection); + return makePtr(_history, (float)_varThreshold, _bShadowDetection); } } diff --git a/modules/video/src/bgfg_gmg.cpp b/modules/video/src/bgfg_gmg.cpp index e3e4232111..f5b7881a0a 100644 --- a/modules/video/src/bgfg_gmg.cpp +++ b/modules/video/src/bgfg_gmg.cpp @@ -485,7 +485,7 @@ void BackgroundSubtractorGMGImpl::release() Ptr createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold) { - Ptr bgfg = new BackgroundSubtractorGMGImpl; + Ptr bgfg = makePtr(); bgfg->setNumFrames(initializationFrames); bgfg->setDecisionThreshold(decisionThreshold); diff --git a/modules/video/src/tvl1flow.cpp b/modules/video/src/tvl1flow.cpp index cdf42f91ef..8d59932750 100644 --- a/modules/video/src/tvl1flow.cpp +++ b/modules/video/src/tvl1flow.cpp @@ -953,5 +953,5 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1", Ptr cv::createOptFlow_DualTVL1() { - return new OpticalFlowDual_TVL1; + return makePtr(); } diff --git a/modules/video/test/test_backgroundsubtractor_gbh.cpp b/modules/video/test/test_backgroundsubtractor_gbh.cpp index a7261516ab..99d53e3d32 100644 --- a/modules/video/test/test_backgroundsubtractor_gbh.cpp +++ b/modules/video/test/test_backgroundsubtractor_gbh.cpp @@ -40,7 +40,7 @@ void CV_BackgroundSubtractorTest::run(int) Ptr fgbg = createBackgroundSubtractorGMG(); Mat fgmask; - if (fgbg.empty()) + if (!fgbg) CV_Error(Error::StsError,"Failed to create Algorithm\n"); /**