Commit 808e0cf1 authored by Roman Donchenko's avatar Roman Donchenko

Boring changes - video.

parent 93f757f8
...@@ -464,7 +464,7 @@ void BackgroundSubtractorMOGImpl::apply(InputArray _image, OutputArray _fgmask, ...@@ -464,7 +464,7 @@ void BackgroundSubtractorMOGImpl::apply(InputArray _image, OutputArray _fgmask,
Ptr<BackgroundSubtractorMOG> createBackgroundSubtractorMOG(int history, int nmixtures, Ptr<BackgroundSubtractorMOG> createBackgroundSubtractorMOG(int history, int nmixtures,
double backgroundRatio, double noiseSigma) double backgroundRatio, double noiseSigma)
{ {
return new BackgroundSubtractorMOGImpl(history, nmixtures, backgroundRatio, noiseSigma); return makePtr<BackgroundSubtractorMOGImpl>(history, nmixtures, backgroundRatio, noiseSigma);
} }
} }
......
...@@ -769,7 +769,7 @@ void BackgroundSubtractorMOG2Impl::getBackgroundImage(OutputArray backgroundImag ...@@ -769,7 +769,7 @@ void BackgroundSubtractorMOG2Impl::getBackgroundImage(OutputArray backgroundImag
Ptr<BackgroundSubtractorMOG2> createBackgroundSubtractorMOG2(int _history, double _varThreshold, Ptr<BackgroundSubtractorMOG2> createBackgroundSubtractorMOG2(int _history, double _varThreshold,
bool _bShadowDetection) bool _bShadowDetection)
{ {
return new BackgroundSubtractorMOG2Impl(_history, (float)_varThreshold, _bShadowDetection); return makePtr<BackgroundSubtractorMOG2Impl>(_history, (float)_varThreshold, _bShadowDetection);
} }
} }
......
...@@ -485,7 +485,7 @@ void BackgroundSubtractorGMGImpl::release() ...@@ -485,7 +485,7 @@ void BackgroundSubtractorGMGImpl::release()
Ptr<BackgroundSubtractorGMG> createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold) Ptr<BackgroundSubtractorGMG> createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold)
{ {
Ptr<BackgroundSubtractorGMG> bgfg = new BackgroundSubtractorGMGImpl; Ptr<BackgroundSubtractorGMG> bgfg = makePtr<BackgroundSubtractorGMGImpl>();
bgfg->setNumFrames(initializationFrames); bgfg->setNumFrames(initializationFrames);
bgfg->setDecisionThreshold(decisionThreshold); bgfg->setDecisionThreshold(decisionThreshold);
......
...@@ -953,5 +953,5 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1", ...@@ -953,5 +953,5 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1",
Ptr<DenseOpticalFlow> cv::createOptFlow_DualTVL1() Ptr<DenseOpticalFlow> cv::createOptFlow_DualTVL1()
{ {
return new OpticalFlowDual_TVL1; return makePtr<OpticalFlowDual_TVL1>();
} }
...@@ -40,7 +40,7 @@ void CV_BackgroundSubtractorTest::run(int) ...@@ -40,7 +40,7 @@ void CV_BackgroundSubtractorTest::run(int)
Ptr<BackgroundSubtractorGMG> fgbg = createBackgroundSubtractorGMG(); Ptr<BackgroundSubtractorGMG> fgbg = createBackgroundSubtractorGMG();
Mat fgmask; Mat fgmask;
if (fgbg.empty()) if (!fgbg)
CV_Error(Error::StsError,"Failed to create Algorithm\n"); CV_Error(Error::StsError,"Failed to create Algorithm\n");
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment