opencv 读取指定的一帧

	const string videoIn = "rain.mp4";
 	VideoCapture captRefrnc(videoIn);

把rain.map读取到 captRefrnc 后 ,captRefrnc.get(CAP_PROP_FRAME_COUNT) 查看总帧数。

想把 比如第1,100帧提取出来比较:

	Mat frame1,frame2;

	captRefrnc.set(CAP_PROP_POS_FRAMES ,1);
	captRefrnc >> frame1;
	imshow("a frame ",frame1);




	captRefrnc.set(CAP_PROP_POS_FRAMES ,100);
	captRefrnc >> frame2;
	imshow("anoter frame ",frame2);
	waitKey();


你可能感兴趣的:(opencv 读取指定的一帧)