Visual c++ 如何使用c+在opencv 3.0.0视频中绘制线条+; 如果你有一个源代码,在使用OpenCV3.0.0的视频中用C++绘制一条线,请告诉我 诚挚的 < P>首先,你应该考虑一个视频基本上只是一些图像快速显示后彼此。因此,您只需要知道如何在图像上画一条线,就可以在视频中绘制它(对每一帧都做相同的操作)。cv::line函数记录在以下位置:

Visual c++ 如何使用c+在opencv 3.0.0视频中绘制线条+; 如果你有一个源代码,在使用OpenCV3.0.0的视频中用C++绘制一条线,请告诉我 诚挚的 < P>首先,你应该考虑一个视频基本上只是一些图像快速显示后彼此。因此,您只需要知道如何在图像上画一条线,就可以在视频中绘制它(对每一帧都做相同的操作)。cv::line函数记录在以下位置:,visual-c++,opencv3.0,Visual C++,Opencv3.0,这将在网络摄像头的视频提要上绘制一条3像素厚的水平黑色线条。如果我想添加另一条与另一条平行的线条并更改线条的颜色?我可以为这个源代码添加什么? int main(int argc, char** argv) { // read the camera input VideoCapture cap(0); if (!cap.isOpened()) return -1; Mat frame; /// Create Window nam

这将在网络摄像头的视频提要上绘制一条3像素厚的水平黑色线条。

如果我想添加另一条与另一条平行的线条并更改线条的颜色?我可以为这个源代码添加什么?
int main(int argc, char** argv)
{
    // read the camera input
    VideoCapture cap(0);

    if (!cap.isOpened())
        return -1;
    Mat frame;

    /// Create Window
    namedWindow("Result", 1);
    while (true) {

        //grab and retrieve each frames of the video sequentially 
        cap >> frame;
        //draw a line onto the frame
        line(frame, Point(0, frame.rows / 2), Point(frame.cols, frame.rows / 2), Scalar(0), 3);
        //display the result
        imshow("Result", frame);
        //wait some time for the frame to render
        waitKey(30);
    }
    return 0;
}