资源简介
frame_difference.zip

代码片段和文件信息
% 感谢亲亲使用此代码,此代码解决您的问题了吗~(@^_^@)~
% 没解决的话告诉亲亲一个好消息,我这里可以1分钱帮助代码改错,还提供1分钱成品代码(′▽‘〃)哦~
% 登录淘宝店铺“大成软件工作室”便可领取
% 是的,亲亲真的没有看错,挠破头皮的问题真的1分钱就可以解决了\(^o^)/YES!
% 小的这就把传送门给您,记得要收藏好哦(づ ̄3 ̄)づ╭~
% 传送门:https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-15151018122.5.uwGoq5&id=538759553146
% 如果传送门失效,亲亲可以来店铺讨要,客服MM等亲亲来骚扰哦~(*/ω╲*)
web https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-15151018122.5.uwGoq5&id=538759553146 -browser
clear all
source = aviread(‘C:\Documents and Settings\Administrator\桌面\matlab视频\sup2‘);
% source = aviread(‘C:\105nm05090‘);
thresh = 30;
bg = source(1).cdata; % read in 1st frame as background frame
bg_bw = rgb2gray(bg); % convert background to greyscale
% ----------------------- set frame size variables -----------------------
fr_size = size(bg);
width = fr_size(2);
height = fr_size(1);
fg = zeros(height width);
% --------------------- process frames -----------------------------------
for i = 2:length(source)
fr = source(i).cdata; % read in frame
fr_bw = rgb2gray(fr); % convert frame to grayscale
fr_diff = abs(double(fr_bw) - double(bg_bw)); % cast operands as double to avoid negative overflow
for j=1:width % if fr_diff > thresh pixel in foreground
for k=1:height
if ((fr_diff(kj) > thresh))
fg(kj) = fr_bw(kj);
else
fg(kj) = 0;
end
end
end
bg_bw = fr_bw;
figure(1)subplot(311)imshow(fr)
subplot(312)imshow(fr_bw)
subplot(313)imshow(uint8(fg))
M(i-1) = im2frame(uint8(fg)gray); % put frames into movie
end
movie2avi(M‘frame_difference_output‘ ‘fps‘ 30); % save movie as avi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-06-13 11:16 fr
文件 2035 2016-09-23 09:55 fr
- 上一篇:山东大学编译原理PL/0语言 compiler实验
- 下一篇:统计模拟及其R实现
相关资源
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
- 联想启天M4350 BIOS升级文件
- 操作系统教程课后答案华中科技大学
- 用友ERP考试系统练习题库及答案
- 北京邮电大学数据结构历年考研真题
- 真正!!!概率论与数理统计浙江大
- TMS320VC5509A_开发板使用手册
- hxdef100源码、远控、后门
- CentOS-6.7-x86_64-bin-DVD1to2
- 点阵字库显示中英文
- caxa实体设计2019破解补丁
评论
共有 条评论