天天看點

【視訊檢測】基于計算機視覺實作目标檢測附matlab代碼

✅作者簡介:熱愛科研的Matlab仿真開發者,修心和技術同步精進,matlab項目合作可私信。

🍎個人首頁:Matlab科研工作室

🍊個人信條:格物緻知。

⛄ 内容介紹

基于視訊的目标檢測與跟蹤是計算機視覺領域主要的研究方向之一。它在智能監控、人機互動、視覺導航等衆多領域有着廣泛應用,并發揮着舉足輕重的作用。本文圍繞視訊目标檢測與跟蹤技術,重點研究了運動檢測、目标比對、跟蹤架構等關鍵技術及方法。

⛄ 部分代碼

Detect Object in Video

close all

clear

clc

SETUP

Load a pre-trained ACF detector.

load('Detector.mat');

Create video file reader for input

vidReader = VideoReader('buoyRun.mp4');

Create video player for visualization

vidPlayer = vision.DeployableVideoPlayer;

Initialise variables 

i = 1;

results = struct('Boxes',[],'Scores',[]);

LOOP

while(hasFrame(vidReader))    

    % GET DATA

    I = readFrame(vidReader);    

    % PROCESS

    [bboxes, scores] = detect(detector,I,'Threshold',1);

    % Select strongest detection 

    [~,idx] = max(scores);

    results(i).Boxes = bboxes;

    results(i).Scores = scores;

    % VISUALIZE

    annotation = sprintf('%s , Confidence %4.2f',detector.ModelName,scores(idx));

    I = insertObjectAnnotation(I,'rectangle',bboxes(idx,:),annotation);

    step(vidPlayer,I);

    i = i+1;   

end

results = struct2table(results);

CLEANUP

release(vidPlayer);

⛄ 運作結果

【視訊檢測】基于計算機視覺實作目标檢測附matlab代碼

⛄ 參考文獻

❤️ 關注我領取海量matlab電子書和數學模組化資料
❤️部分理論引用網絡文獻,若有侵權聯系部落客删除