Skip to content

Instantly share code, notes, and snippets.

View angelskieglazki's full-sized avatar
🖤
:)

angel eyes angelskieglazki

🖤
:)
  • Moscow
View GitHub Profile
@angelskieglazki
angelskieglazki / extract_frames.cpp
Created October 20, 2015 10:04 — forked from itsrifat/extract_frames.cpp
simple c++ functions to extract frames of a video file into a vector of Mat and saving the vector as jpg images using OpenCV 2.4.9
/*
This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img)
*/
void extract_frames(const string &videoFilePath,vector<Mat>& frames){
try{
//open the video file
VideoCapture cap(videoFilePath); // open the video file
if(!cap.isOpened()) // check if we succeeded
CV_Error(CV_StsError, "Can not open Video file");