我現在目前正在BackgroundSubtractorMOG和BackgroundSubtractorMOG2在OpenCV中,我想嘗試JPG圖像序列作爲我的幀如何讀取OpenCV中「.jpg」圖像的序列?
frame = imread("C:\images\001-capture.jpg");
if(!frame.data){
//error in opening the first image
cerr << "Unable to open first image frame: " << fistFrameFilename << endl;
//exit(EXIT_FAILURE);
}
的人士還因爲當我用VideoCapture訪問我,我得到錯誤。 avi視頻剪輯。
VideoCapture capture("C:\movie1.avi");
if(!capture.isOpened()){
//error in opening the video input
cerr << "Unable to open video file: " << videoFilename << endl;
exit(EXIT_FAILURE);
}
//read input data. ESC or 'q' for quitting
while((char)keyboard != 'q' && (char)keyboard != 27){
//read the current frame
if(!capture.read(frame)) {
cerr << "Unable to read next frame." << endl;
cerr << "Exiting..." << endl;
exit(EXIT_FAILURE);
}