Write Videos & Images
来源:互联网 发布:穿越火线歌词网络歌曲 编辑:程序博客网 时间:2024/04/30 00:05
1.Write Videos
#include <iostream>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;int main(int argc, char **argv) { time_t t=time(0); string x=to_string(t); VideoCapture capture(0); double rate = 25.0;//视频的帧率 Size videoSize(640,480); VideoWriter writer(x+".avi", CV_FOURCC('M', 'J', 'P', 'G'), rate, videoSize); Mat frame; while (capture.isOpened()) { capture >> frame; writer << frame; imshow("video", frame); if (waitKey(20) == 27)//27是键盘摁下esc时,计算机接收到的ascii码值 { break; } } }
2.Write Images
#include <iostream>#include<opencv2/core/core.hpp>#include<opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;#include<string.h>#include<string>#include <sys/time.h> long getCurrentTime() { struct timeval tv; gettimeofday(&tv,NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; } int main(int argc, char **argv) { VideoCapture cap(0); Mat src; string b="~/Desktop/YZJPrograme/ImageCapture/1/"; string c=".jpg"; while(true) { cap>>src; cout<<getCurrentTime()<<endl; // cout<<time(0)<<endl; string s; int x=1000; s=to_string(getCurrentTime()); imwrite(s+c,src); imshow("s",src); if(waitKey(100)==27) break; } return 0;}
0 0
- Write Videos & Images
- RWD Images & Videos
- 人体检测HOG特征 Finding People in Images and Videos
- JXL : write images and... into excel
- 局部自相似描述子论文《Matching Local Self-Similarities across Images and Videos》读后感
- images
- images
- images
- images
- images
- images
- HTML Videos
- Good Videos
- write
- WRITE
- write
- write()
- write
- JZOJ 3747 【NOI2014模拟7.14】Problem C
- DataUtil
- 深入理解Java虚拟机--读书笔记3/3
- LeetCode之Detect Capital
- 登录密码
- Write Videos & Images
- 关于centos7 安装mysql(mariadb)的方式
- 最小生成树和最短路径的对比
- android常用布局与点击事件、安卓体系结构
- 多驱动 多设备编程,
- linux命令iostat详解
- csp-2017-3 分蛋糕
- 蓝桥杯 移动距离
- Android6.0新特性---权限管理