opencv_trail_effect.cpp: fix showing the background
authorAntonio Ospite <ao2@ao2.it>
Thu, 22 Feb 2018 12:12:04 +0000 (13:12 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 22 Feb 2018 14:41:51 +0000 (15:41 +0100)
commit5ac5412e847a0abaeaf83c3a0299e68ffaec10f1
treee352f9a009e6ac58b16e9fb9d415ff4601974f92
parent1fb92e6c58573d8188e8fe2cd49257409d15f527
opencv_trail_effect.cpp: fix showing the background

When showing the background OpenCV would fail with this message:

  OpenCV Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in copyTo, file /build/opencv-lY8WRY/opencv-3.2.0+dfsg/modules/core/src/copy.cpp, line 259
  terminate called after throwing an instance of 'cv::Exception'
    what():  /build/opencv-lY8WRY/opencv-3.2.0+dfsg/modules/core/src/copy.cpp:259: error: (-215) channels() == CV_MAT_CN(dtype) in function copyTo

Initializing the background to the same format of the input frame seems
to fix this.
opencv_trail_effect.cpp