当前位置:网站首页>2022-07-04 matlab读取视频帧并保存
2022-07-04 matlab读取视频帧并保存
2022-07-07 16:50:00 【紫云无堤】
%%
filename = dir('**/*.mp4');
parfor fileIndex = 1:size(filename, 1)
frameFolder = strcat(filename(fileIndex).folder, '\ImageTest');
if ~exist(frameFolder, 'dir')
mkdir(frameFolder);
end
file = strcat(filename(fileIndex).folder, '\',filename(fileIndex).name);
obj = VideoReader(file);
% Number of frames
numFrames = obj.NumFrames;
for k = 1 : numFrames
% Read frame
frame = read(obj, k);
% Show frame image
% imshow(frame);
% Save frame image 0001.jpg, 0002.jpg
imwrite(frame,strcat(frameFolder, '\',sprintf('%04d.jpg',k)),'jpg');
end
end
边栏推荐
- Summary of debian10 system problems
- Classification of regression tests
- 线程池和单例模式以及文件操作
- Rules for filling in volunteers for college entrance examination
- Idea completely uninstalls installation and configuration notes
- [trusted computing] Lesson 13: TPM extended authorization and key management
- Unlike the relatively short-lived industrial chain of consumer Internet, the industrial chain of industrial Internet is quite long
- 高考填志愿规则
- Improve application security through nonce field of play integrity API
- AI defeated mankind and designed a better economic mechanism
猜你喜欢
五种网络IO模型
[paper sharing] where's crypto?
Backup Alibaba cloud instance OSS browser
Tear the Nacos source code by hand (tear the client source code first)
How to clean when win11 C disk is full? Win11 method of cleaning C disk
A few simple steps to teach you how to see the K-line diagram
AI 击败了人类,设计了更好的经济机制
Redis
NAT地址转换
伺服力矩控制模式下的力矩目标值(fTorque)计算
随机推荐
你真的理解粘包与半包吗?3分钟搞懂它
[demo] circular queue and conditional lock realize the communication between goroutines
同消费互联网的较为短暂的产业链不同,产业互联网的产业链是相当漫长的
Kubernetes DevOps CD工具对比选型
通过 Play Integrity API 的 nonce 字段提高应用安全性
[paddleseg source code reading] add boundary IOU calculation in paddleseg validation (1) -- val.py file details tips
[trusted computing] Lesson 13: TPM extended authorization and key management
Redis的发布与订阅
线程池和单例模式以及文件操作
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
学习open62541 --- [67] 添加自定义Enum并显示名字
[unity shader] insert pass to realize the X-ray perspective effect of model occlusion
Thread pool and singleton mode and file operation
Idea completely uninstalls installation and configuration notes
[trusted computing] Lesson 10: TPM password resource management (II)
Tips for this week 140: constants: safety idioms
不能忽略的现货白银短线操作小技巧
备份阿里云实例-oss-browser
磁盘存储链式的B树与B+树
A few simple steps to teach you how to see the K-line diagram