简体   繁体   中英

how to get first frame from Camera capture in opencv C++

I want to get only first frame from the video, which is capture by the webcam. If anyone know how to do it please help me

Thank you...

auto Video_URL = "c:/sample.mp4";
cv::VideoCapture cap(Video_URL);
cv::Mat frame;

if (cap.read(frame)){
    //Do something with frame
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM