资源简介
卡尔曼滤波跟踪视频目标matlab程序,简单易懂
代码片段和文件信息
function multiobjectTracking()
% create system objects used for reading video detecting moving objects
% and displaying the results
obj = setupSystemobjects(); %初始化函数
tracks = initializeTracks(); % create an empty array of tracks %初始化轨迹对象
nextId = 1; % ID of the next track
% detect moving objects and track them across video frames
while ~isDone(obj.reader)
frame = readframe(); %读取一帧
[centroids bboxes mask] = detectobjects(frame); %前景检测
predictNewLocationsOfTracks(); %根据位置进行卡尔曼预测
[assignments unassignedTracks unassignedDetections] = ...
detectionToTrackAssignment(); %匈牙利匹配算法进行匹配
updateAssignedTracks();%分配好的轨迹更新
updateUnassignedTracks();%未分配的轨迹更新
deleteLostTracks();%删除丢掉的轨迹
createNewTracks();%创建新轨迹
displayTrackingResults();%结果展示
end
%% Create System objects
% Create System objects used for reading the video frames detecting
% foreground objects and displaying results.
function obj = setupSystemobjects()
% Initialize Video I/O
% Create objects for reading a video from a file drawing the tracked
% objects in each frame and playing the video.
% create a video file reader
obj.reader = vision.VideoFileReader(‘atrium.avi‘); %读入视频
% create two video players one to display the video
% and one to display the foreground mask
obj.videoPlayer = vision.VideoPlayer(‘Position‘ [20 400 700 400]); %创建两个窗口
obj.maskPlayer = vision.VideoPlayer(‘Position‘ [740 400 700 400]);
% Create system objects for foreground detection and blob analysis
% The foreground detector is used to segment moving objects from
% the background. It outputs a binary mask where the pixel value
% of 1 corresponds to the foreground and the value of 0 corresponds
% to the background.
obj.detector = vision.ForegroundDetector(‘NumGaussians‘ 3 ... %GMM进行前景检测,高斯核数目为3,前40帧为背景帧,域值为0.7
‘NumTrainingframes‘ 40 ‘MinimumBackgroundRatio‘ 0.7);
% Connected groups of foreground pixels are likely to correspond to moving
% objects. The blob analysis system object is used to find such groups
% (called ‘blobs‘ or ‘connected components‘) and compute their
% characteristics such as area centroid and the bounding box.
obj.blobAnalyser = vision.BlobAnalysis(‘BoundingBoxOutputPort‘ true ... %输出质心和外接矩形
‘AreaOutputPort‘ true ‘CentroidOutputPort‘ true ...
‘MinimumBlobArea‘ 400);
end
%% Initialize Tracks
% The |initializeTracks| function creates an array of tracks where each
% track is a structure representing a moving object in the video. The
% purpose of the structure is to maintain the state of a tracked object.
% The state consists of information used for detection to track
- 上一篇:DSP 在图像处理中的应用
- 下一篇:粒子群搜索代码
相关资源
- UKF无迹卡尔曼滤波算法matlab代码
- 利用matlab实现的简单的基于卡尔曼滤
- 粒子滤波代码与卡尔曼做比较
- 当前模型卡尔曼滤波算法资料
- 基于卡尔曼滤波的机器人slam导航算法
- 自动驾驶多目标检测.7z
- 平方根无迹卡尔曼滤波算法程序
- TDOA/AOA定位的扩展卡尔曼滤波定位算法
- 小波变换(去噪融合)和卡尔曼滤波
- 自适应卡尔曼滤波器的matlab实现
- 卡尔曼滤波用于自由落体运动目标跟
- 3.19 基于Kalman滤波的目标跟踪.rar
- 基于背景差分法和卡尔曼滤波器的追
- EKF扩展卡尔曼滤波程序
- TDOA_AOA定位的扩展卡尔曼滤波算法MA
- 卡尔曼滤波在雷达目标跟踪中的应用
- 扩展卡尔曼滤波程序(matlab实现)
- 基于卡尔曼滤波的视频人脸跟踪MATL
- 卡尔曼滤波算法原理及MATLAB源程序
- 拥有matlab用户界面的卡尔曼滤波程序
- [网盘]卡尔曼滤波原理及应用MATLAB仿真
- EKF机器人定位-MATLAB.m
- Kalman滤波在船舶GPS导航定位系统中的
- 基于卡尔曼滤波的定位算法MATLAB程序
- 基于卡尔曼滤波算法的主从时钟同步
- MATLAB卡尔曼滤波伪距单点定位
- 一维信号前提下粒子滤波器和卡尔曼
-
卡尔曼滤波器在simuli
nk 中的实现 - 卡尔曼滤波器的PID控制
- 基于卡尔曼滤波算法的雷达追踪算法
评论
共有 条评论