opencv读取本地视频

#include  
#include  
#include 

using namespace cv;

int main(int argc, char** argv)
{

	VideoCapture cap("E:\\A_Develope\\test_video\\fitness.avi");
	if (!cap.isOpened())
	{
		return -1;
	}
	Mat frame;
	while (1)
	{
		cap >> frame;
		if (frame.empty()) break;
		imshow("当前视频", frame);
		if (waitKey(30) >= 0)
			break;
	}
	return 0;
}

你可能感兴趣的:(OpenCV)