#include <opencv2/opencv.hpp>
using namespace cv;
int main(){
VideoCapture capture("Basler acA1600-20gc_2.mp4");
while (1)
{
Mat frame;
capture >> frame;
Mat deges;
cvtColor(frame, deges, CV_BGR2GRAY);
blur(deges, deges, Size(7, 7));//进行模糊
Canny(deges, deges, 0, 30, 3);
imshow("读取视频", deges);
waitKey(30);
}
return 0;
}
OpenCV视频读取,并进行canny边缘检测
最新推荐文章于 2023-02-13 17:37:49 发布