Commit d253a0fa authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

bgsegm: convert rgb images to gray in CNT

parent 34f910bb
......@@ -341,9 +341,12 @@ private:
void BackgroundSubtractorCNTImpl::apply(InputArray image, OutputArray _fgmask, double learningRate)
{
CV_Assert(image.type() == CV_8UC1);
CV_Assert(image.depth() == CV_8U);
Mat frameIn = image.getMat();
if(frameIn.channels() != 1)
cvtColor(frameIn, frameIn, COLOR_BGR2GRAY);
_fgmask.create(image.size(), CV_8U); // OutputArray usage requires this step
Mat fgMask = _fgmask.getMat();
......
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