Merge pull request #680 from vpisarev:c2cpp_video_take2
This commit is contained in:
@@ -632,10 +632,10 @@ PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::BackgroundSubtractorMOG mog;
|
||||
cv::Ptr<cv::BackgroundSubtractor> mog = cv::createBackgroundSubtractorMOG();
|
||||
cv::Mat foreground;
|
||||
|
||||
mog(frame, foreground, learningRate);
|
||||
mog->apply(frame, foreground, learningRate);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
@@ -653,7 +653,7 @@ PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
|
||||
}
|
||||
|
||||
startTimer(); next();
|
||||
mog(frame, foreground, learningRate);
|
||||
mog->apply(frame, foreground, learningRate);
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
@@ -731,12 +731,12 @@ PERF_TEST_P(Video_Cn, Video_MOG2,
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::BackgroundSubtractorMOG2 mog2;
|
||||
mog2.set("detectShadows", false);
|
||||
cv::Ptr<cv::BackgroundSubtractor> mog2 = cv::createBackgroundSubtractorMOG2();
|
||||
mog2->set("detectShadows", false);
|
||||
|
||||
cv::Mat foreground;
|
||||
|
||||
mog2(frame, foreground);
|
||||
mog2->apply(frame, foreground);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
@@ -754,7 +754,7 @@ PERF_TEST_P(Video_Cn, Video_MOG2,
|
||||
}
|
||||
|
||||
startTimer(); next();
|
||||
mog2(frame, foreground);
|
||||
mog2->apply(frame, foreground);
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
@@ -815,7 +815,7 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::BackgroundSubtractorMOG2 mog2;
|
||||
cv::Ptr<cv::BackgroundSubtractor> mog2 = cv::createBackgroundSubtractorMOG2();
|
||||
cv::Mat foreground;
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
@@ -833,12 +833,12 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
|
||||
cv::swap(temp, frame);
|
||||
}
|
||||
|
||||
mog2(frame, foreground);
|
||||
mog2->apply(frame, foreground);
|
||||
}
|
||||
|
||||
cv::Mat background;
|
||||
|
||||
TEST_CYCLE() mog2.getBackgroundImage(background);
|
||||
TEST_CYCLE() mog2->getBackgroundImage(background);
|
||||
|
||||
CPU_SANITY_CHECK(background);
|
||||
}
|
||||
@@ -923,11 +923,11 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
|
||||
cv::Mat foreground;
|
||||
cv::Mat zeros(frame.size(), CV_8UC1, cv::Scalar::all(0));
|
||||
|
||||
cv::BackgroundSubtractorGMG gmg;
|
||||
gmg.set("maxFeatures", maxFeatures);
|
||||
gmg.initialize(frame.size(), 0.0, 255.0);
|
||||
cv::Ptr<cv::BackgroundSubtractor> gmg = cv::createBackgroundSubtractorGMG();
|
||||
gmg->set("maxFeatures", maxFeatures);
|
||||
//gmg.initialize(frame.size(), 0.0, 255.0);
|
||||
|
||||
gmg(frame, foreground);
|
||||
gmg->apply(frame, foreground);
|
||||
|
||||
for (int i = 0; i < 150; ++i)
|
||||
{
|
||||
@@ -950,7 +950,7 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
|
||||
}
|
||||
|
||||
startTimer(); next();
|
||||
gmg(frame, foreground);
|
||||
gmg->apply(frame, foreground);
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user