当前位置:网站首页>【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附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
边栏推荐
- How to create bep-20 pass on BNB chain
- php参考手册String(7.2千字)
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
- MySQL数据库 - 数据库和表的基本操作(二)
- 如何在BNB鏈上創建BEP-20通證
- Database query - course selection system
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行3
- Fundamentals of programming language (2)
- The difference between underline and dot of golang import package
- IIS数据转换问题16bit转24bit
猜你喜欢
Building googlenet neural network based on pytorch for flower recognition
aqs的学习
Grafana shares links with variable parameters
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
Fundamentals of programming language (2)
5 minutes to achieve wechat cloud applet payment function (including source code)
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(五)
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
随机推荐
php参考手册String(7.2千字)
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行
本地调用feign接口报404
【webrtc】Add x264 encoder for CEF/Chromium
The usage of slice and the difference between slice and array
C学习完结
程序设计语言基础(2)
R语言ggplot2可视化分面图(facet_wrap)、使用lineheight参数自定义设置分面图标签栏(灰色标签栏)的高度
Fundamentals of programming language (2)
Devops integration - environment variables and building tools of Jenkins service
视频理解-Video Understanding
Kibana reports an error server is not ready yet. Possible causes
音频编辑生成软件
CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
Lpc1768 optimization comparison of delay time and different levels
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
[webrtc] add x264 encoder for CEF / Chromium
MySQL数据库 - 数据库和表的基本操作(二)
Unity general steps for creating a hyper realistic 3D scene
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies