91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5.76MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-09-22
  • 語言: Matlab
  • 標(biāo)簽:

資源簡介

matlab官方所提供的基于卡爾曼濾波的目標(biāo)跟蹤算法demo,核心部分使用了計算機(jī)視覺工具箱,本人將其簡化并加入漢語注釋,使其更加通俗易懂,運(yùn)行環(huán)境為matlab2014

資源截圖

代碼片段和文件信息

clc;

frame????????????=?[];??
detectedLocation?=?[];??%檢測到的位置
trackedLocation??=?[];??%跟蹤到的位置
label????????????=?‘‘;??%球的標(biāo)簽
??
motionModel???????????=?‘ConstantAcceleration‘;???????%運(yùn)動模式
initialLocation???????=?‘Same?as?first?detection‘;????%初始化位置
initialEstimateError??=?1E5?*?ones(1?3);?????????????%初始化估算誤差
motionNoise???????????=?[25?10?1];??????????????????%運(yùn)動噪聲
measurementNoise??????=?25;???????????????????????????%測量噪聲
segmentationThreshold?=?0.05;?????????????????????????%分割閾值

videoReader?=?vision.VideoFileReader(‘movie.avi‘);
videoPlayer?=?vision.VideoPlayer(‘Position‘?[100100500400]);
foregroundDetector?=?vision.ForegroundDetector(...?????????????????????%前景色探測器
??‘NumTrainingframes‘?10?‘InitialVariance‘?segmentationThreshold);
blobAnalyzer?=?vision.BlobAnalysis(‘AreaOutputPort‘?false?...????????
????‘MinimumBlobArea‘?70?‘CentroidOutputPort‘?true);
accumulatedImage??????=?0;????????????????????????????%累積的圖片
accumulatedDetections?=?zeros(0?2);??????????????????%累積的探測值
accumulatedTrackings??=?zeros(0?2);??????????????????%累積的蹤跡
isTrackInitialized?=?false;

while?~isDone(videoReader)
????frame?=?step(videoReader);????????????????????????
????grayImage?=?rgb2gray(frame);??????????????????????%圖像灰度化
????foreground?=?step(foregroundDetector?grayImage);
????detectedLocation?=?step(blobAnalyzer?foreground);
????if?isempty(detectedLocation)
????????isobjectDetected?=?false;
????else
????????isobjectDetected?=?true;
????????detectedLocation?=?detectedLocation(1?:);
????end
????
????if?~isTrackInitialized
????????if?isobjectDetected
????????????if?strcmp(initialLocation?‘Same?as?first?detection‘)
????????????????initialLocation?=?detectedLocation;
????????????end
????????????
????????????kalmanFilter?=?configureKalmanFilter(motionModel?...
????????????initialLocation?initialEstimateError?...
????????????motionNoise?measurementNoise);
????????
????????????isTrackInitialized?=?true;
????????????trackedLocation?=?correct(kalmanFilter?detectedLocation);
????????????label?=?‘Initial‘;
????????else
????????????trackedLocation?=?[];
????????????label?=?‘‘;
????????end
????else
????????if?isobjectDetected
????????????predict(kalmanFilter);
????????????trackedLocation?=?correct(kalmanFilter?detectedLocation);
????????????label?=?‘Corrected‘;
????????else
????????????trackedLocation?=?predict(kalmanFilter);
????????????label?=?‘Predicted‘;
????????end???
????end
????
????accumulatedImage?=?max(accumulatedImage?frame);
????accumulatedDetections?=?[accumulatedDetections;?detectedLocation];
????accumulatedTrackings??=?[accumulatedTrackings;?trackedLocation];
????
????combinedImage?=?max(repmat(foreground?[113])?frame);
????
????if?~isempty(trackedLocation)
????????shape?=?‘circle‘;
????????region?=?trackedLocation;
????????region(:?3)?=?5;
????????combinedImage?=?insertobjectAnnotation(combinedImage?shape?...
??????????region?{label}?‘Color‘?‘red‘

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-06-11?10:47??kalman目標(biāo)跟蹤\
?????文件????????3424??2016-04-30?09:50??kalman目標(biāo)跟蹤\demoForTracking.m
?????文件????23405568??2012-05-12?06:37??kalman目標(biāo)跟蹤\movie.avi
?????文件????????8704??2016-06-11?10:47??kalman目標(biāo)跟蹤\Thumbs.db

評論

共有 條評論