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

  • 大小: 16KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-10
  • 語言: Matlab
  • 標簽:

資源簡介

卡爾曼濾波跟蹤視頻目標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

評論

共有 條評論