fix bug in gpu bgsegm sample
authorVladislav Vinogradov <vlad.vinogradov47@gmail.com>
Sat, 19 Oct 2013 08:40:10 +0000 (12:40 +0400)
committerVladislav Vinogradov <vlad.vinogradov47@gmail.com>
Sat, 19 Oct 2013 08:40:10 +0000 (12:40 +0400)
create `d_fgimg` matrix before cleaning.

samples/gpu/bgfg_segm.cpp

index 6963e75..47edbe7 100644 (file)
@@ -146,6 +146,7 @@ int main(int argc, const char** argv)
         double fps = cv::getTickFrequency() / (cv::getTickCount() - start);
         std::cout << "FPS : " << fps << std::endl;
 
+        d_fgimg.create(d_frame.size(), d_frame.type());
         d_fgimg.setTo(Scalar::all(0));
         d_frame.copyTo(d_fgimg, d_fgmask);