openCV Error: Assertion failed (scn == 3 || scn == 4)

徘徊边缘 提交于 2019-11-27 14:03:40

You need to check your frame is empty or not after each query

Like

   frame=cvQueryFrame(capture);
     if (frame.empty()) break;

You are getting such an error because you are trying to convert an empty Mat to grayscale after last frame, so exit the loop if frame is empty.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!