当前位置:网站首页>【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
2022-04-23 20:06:00 【Matlab科研工作室】
1 简介
为解决视频帧目标跟踪中的尺度变化导致的目标跟踪发生跟丢的问题,提出一种自适应跟踪窗口的处理方法,利用下一帧的估计位置与当前帧目标位置的差值作为检测量,自适应调整跟踪窗口,实现目标的有效检测和跟踪.实验结果表明:该方法能有效降低目标跟丢的概率,预防目标的误跟踪,适应目标尺度变化.
2 部分代码
% extracts the center (cc,cr) and radius of the largest blob
function [stats,N,flag,foremm]=extract(Imwork,Imback,index)%,fig1,fig2,fig3,fig15,index)
cc = 0;
cr = 0;
flag = 0;
[MR,MC,Dim] = size(Imback);
%Imwork(:,:,1),Imwork(:,:,2),Imwork(:,:,3),分别是图像的RGB值,
%程序的目的是提取两幅图R,G,B三个通道的差值大于10的部分(二值化)
% subtract background & select pixels with a big difference
fore = zeros(MR,MC);
fore = imabsdiff(Imwork,Imback);
%进行二值化,去除图像噪声
Im2=im2bw(fore,80/255);
%对图像进行膨胀操作
foremm = bwmorph(Im2,'dilate',4); %2 time
% select largest object
labeled = bwlabel(foremm,4); %标注二进制图像中已连接的部分。
stats = regionprops(labeled,['basic']); %获取label的图形属性 %使用字符串'basic',则属性:'Area','Centroid'和'BoundingBox'将被计算
[N,W] = size(stats);
if N < 1
return
end
% do bubble sort (large to small) on regions in case there are more than 1
id = zeros(N); % N为检测到的目标的个数
for i = 1 : N
id(i) = i;
end
for i = 1 : N-1
for j = i+1 : N
if stats(i).Area < stats(j).Area
tmp = stats(i);
stats(i) = stats(j);
stats(j) = tmp;
tmp = id(i);
id(i) = id(j);
id(j) = tmp;
end
end
end
% make sure that there is at least 1 big region
if stats(1).Area < 100
return
end
%selected = (labeled==id(1));
flag = 1;
return
3 仿真结果
4 参考文献
[1]李妍妍, 田瑞娟, 张弦弦. 一种基于帧差法结合Kalman滤波的运动目标跟踪方法[J]. 兵工自动化, 2019, 38(4):4.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
版权声明
本文为[Matlab科研工作室]所创,转载请带上原文链接,感谢
https://matlabzhushou.blog.csdn.net/article/details/124367293
边栏推荐
- [报告] Microsoft :Application of deep learning methods in speech enhancement
- MySQL syntax collation (4)
- Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
- R语言使用timeROC包计算无竞争风险情况下的生存资料多时间AUC值、使用confint函数计算无竞争风险情况下的生存资料多时间AUC指标的置信区间值
- 【webrtc】Add x264 encoder for CEF/Chromium
- Speex维纳滤波与超几何分布的改写
- Mysql database - connection query
- DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
- Esp8266 - beginner level Chapter 1
- MySQL数据库 - 单表查询(三)
猜你喜欢
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
山大网安靶场实验平台项目—个人记录(四)
Leetcode XOR operation
5 minutes to achieve wechat cloud applet payment function (including source code)
ESP8266-入门第一篇
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
MySQL syntax collation (4)
aqs的学习
@MapperScan与@Mapper
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
随机推荐
Grafana shares links with variable parameters
NC basic usage 2
还在用 ListView?使用 AnimatedList 让列表元素动起来
[2022] regard 3D target detection as sequence prediction - point2seq: detecting 3D objects as sequences
MySQL syntax collation (4)
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
nc基础用法4
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
【webrtc】Add x264 encoder for CEF/Chromium
数据库查询 - 选课系统
Comment créer un pass BEP - 20 sur la chaîne BNB
[webrtc] add x264 encoder for CEF / Chromium
Building googlenet neural network based on pytorch for flower recognition
Distinction between pointer array and array pointer
【webrtc】Add x264 encoder for CEF/Chromium
Design of warehouse management database system
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (6)
Devops integration - environment variables and building tools of Jenkins service
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
MFC obtains local IP (used more in network communication)