实战深度学习OpenCV(三):视频实时canny边缘检测

#include <stdio.h>
#include"opencv2/opencv.hpp"  
using namespace cv;


int main()
{
    VideoCapture a(0);
    Mat edge;
    while (1)
    {
        Mat frame;
        a >> frame;
        cvtColor(frame,edge,CV_BGR2GRAY);
        blur(edge,edge,Size(7,7));
        Canny(edge, edge, 0, 30, 3);
        imshow("被canny后的视频",edge);
        waitKey(2);


    }
    return 0;
}

 

posted @ 2018-12-04 11:03  Geeksongs  阅读(1005)  评论(0编辑  收藏  举报

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.