int main(int argc, char* argv[])
{
VideoCapture cap(0);
Mat current_frame;
Mat previous_frame;
Mat result;
Mat frame;
//cap.open(-1);
if (!cap.isOpened()) {
//cerr << "can not open camera or video file" << endl;
return -1;
}
while(1)
{
cap >> current_frame;
if (current_frame.empty())
break;
if (! previous_frame.empty()) {
// subtract frames
subtract(current_frame, previous_frame, result);
}
imshow("Window", result);
waitKey(10);
frame.copyTo(previous_frame);
}
}
当我运行此程序以从前一帧中减去当前帧然后显示结果帧时,它在开始执行时向我显示此错误
WK01.exe 中 0x755d812f 处的未处理异常:Microsoft C++ 异常:内存位置 0x001fe848 处的 cv::Exception..
我想在录制的视频上应用同样的东西