功能就是把一幅原视频给直接撸成边缘算子处理过的视频
然后撸上一发代码:
VideoCapture capture("d:/长东视频测试/123.avi"); //读入视频
if (!capture.isOpened())
return 1;
double rate = capture.get(CV_CAP_PROP_FPS);
bool stop(false);
Mat frame;
namedWindow("Canny Video");
int delay = 1000 / rate;
while (!stop)
{
if (!capture.read(frame))
break;
Mat result;
Canny(frame, result, 100, 200); //边缘算子处理,保存结果在result里面
threshold(result, result, 128, 255, THRESH_BINARY);
imshow("Canny Video", result);
if (waitKey(delay) >= 0)
stop = true;
}
capture.release();