首页 > 解决方案 > VideoCapture.Open 失败

问题描述

它总是无法打开并打印出里面的东西if (!capVideo.isOpened()),是的,我确定路径是正确的

cv::VideoCapture capVideo;

capVideo.open("C:\\Users\\Eren\\Desktop\\vid.mp4");

if (!capVideo.isOpened()) { // if unable to open video file
    std::cout << "error reading video file" << std::endl << std::endl;  
    capVideo.open("C:\\Users\\Eren\\Desktop\\vid.mp4");// show error message
    _getch();  // it may be necessary to change or remove this line if not using Windows
    return(0);  // and exit program
}

标签: c++opencvobjectobject-detectiondetection

解决方案


推荐阅读