samples: gpu: performance: removed FGDStatModel performance comparison test
The FGD background subtraction model was part of opencv_legacy module; as it is gone now, it makes little sense to benchmark the GPU version, either, so the whole test is removed.
This commit is contained in:
@@ -1266,63 +1266,6 @@ TEST(FarnebackOpticalFlow)
|
|||||||
}}}
|
}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace cv
|
|
||||||
{
|
|
||||||
template<> void DefaultDeleter<CvBGStatModel>::operator ()(CvBGStatModel* obj) const
|
|
||||||
{
|
|
||||||
cvReleaseBGStatModel(&obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(FGDStatModel)
|
|
||||||
{
|
|
||||||
const std::string inputFile = abspath("768x576.avi");
|
|
||||||
|
|
||||||
VideoCapture cap(inputFile);
|
|
||||||
if (!cap.isOpened()) throw runtime_error("can't open 768x576.avi");
|
|
||||||
|
|
||||||
Mat frame;
|
|
||||||
cap >> frame;
|
|
||||||
|
|
||||||
IplImage ipl_frame = frame;
|
|
||||||
Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
|
|
||||||
|
|
||||||
while (!TestSystem::instance().stop())
|
|
||||||
{
|
|
||||||
cap >> frame;
|
|
||||||
ipl_frame = frame;
|
|
||||||
|
|
||||||
TestSystem::instance().cpuOn();
|
|
||||||
|
|
||||||
cvUpdateBGStatModel(&ipl_frame, model);
|
|
||||||
|
|
||||||
TestSystem::instance().cpuOff();
|
|
||||||
}
|
|
||||||
TestSystem::instance().cpuComplete();
|
|
||||||
|
|
||||||
cap.open(inputFile);
|
|
||||||
|
|
||||||
cap >> frame;
|
|
||||||
|
|
||||||
cuda::GpuMat d_frame(frame), d_fgmask;
|
|
||||||
Ptr<BackgroundSubtractor> d_fgd = cuda::createBackgroundSubtractorFGD();
|
|
||||||
|
|
||||||
d_fgd->apply(d_frame, d_fgmask);
|
|
||||||
|
|
||||||
while (!TestSystem::instance().stop())
|
|
||||||
{
|
|
||||||
cap >> frame;
|
|
||||||
d_frame.upload(frame);
|
|
||||||
|
|
||||||
TestSystem::instance().gpuOn();
|
|
||||||
|
|
||||||
d_fgd->apply(d_frame, d_fgmask);
|
|
||||||
|
|
||||||
TestSystem::instance().gpuOff();
|
|
||||||
}
|
|
||||||
TestSystem::instance().gpuComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(MOG)
|
TEST(MOG)
|
||||||
{
|
{
|
||||||
const std::string inputFile = abspath("768x576.avi");
|
const std::string inputFile = abspath("768x576.avi");
|
||||||
|
Reference in New Issue
Block a user