当前位置:网站首页>【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附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
边栏推荐
- MySQL syntax collation (4)
- A simple (redisson based) distributed synchronization tool class encapsulation
- Deep learning -- Summary of Feature Engineering
- Mysql database - single table query (I)
- VeraCrypt文件硬盘加密使用教程
- MFC obtains local IP (used more in network communication)
- SRS deployment
- uIP1. 0 actively sent problem understanding
- Zero cost, zero foundation, build profitable film and television applet
- FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
猜你喜欢
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
如何在BNB链上创建BEP-20通证
Command - sudo
MySQL 进阶 锁 -- MySQL锁概述、MySQL锁的分类:全局锁(数据备份)、表级锁(表共享读锁、表独占写锁、元数据锁、意向锁)、行级锁(行锁、间隙锁、临键锁)
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
MySQL lock
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
如何在BNB鏈上創建BEP-20通證
MySQL syntax collation (4)
随机推荐
Video understanding
[报告] Microsoft :Application of deep learning methods in speech enhancement
Unity general steps for creating a hyper realistic 3D scene
Class loading process of JVM
还在用 ListView?使用 AnimatedList 让列表元素动起来
Build intelligent garbage classification applet based on Zero
Design of library management database system
Compact CUDA tutorial - CUDA driver API
Distinction between pointer array and array pointer
程序设计语言基础(2)
如何在BNB鏈上創建BEP-20通證
Go recursively loops through folders
MySQL advanced lock - overview of MySQL locks and classification of MySQL locks: global lock (data backup), table level lock (table shared read lock, table exclusive write lock, metadata lock and inte
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
Why is the hexadecimal printf output of C language sometimes with 0xff and sometimes not
5 minutes to achieve wechat cloud applet payment function (including source code)
深度分析数据恢复原理——那些数据可以恢复那些不可以数据恢复软件
Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
C6748 software simulation and hardware test - with detailed FFT hardware measurement time
C学习完结