Matlab:使用卡尔曼滤波器的对象/车辆检测跟踪

时间:2019-01-13 14:37:40

标签: matlab computer-vision object-detection kalman-filter

我在Matlab中有以下代码用于对象检测:

load('acfDetector1.mat')

videoFile   = 'testvideo.mp4';
videoReader = VideoReader(videoFile);
videoPlayer = vision.DeployableVideoPlayer();

currentStep = 0;
snapshot = [];
snapTimeStamp = 120;
cont = hasFrame(videoReader);
while cont
    % Update frame counters.
    currentStep = currentStep + 1;

    % Read the next frame.
    frame = readFrame(videoReader);

    % [x,y,width, height]
    [bboxes,scores] = detect(acfDetector1,frame); %bboxes = [x,y,w,h]

    Refpoint = [(bboxes(1)+(bboxes(3)/2)), (bboxes(2)+bboxes(4))];

    annotation = sprintf('Confidence = %.1f',scores(:));
    img = insertObjectAnnotation(frame,'rectangle',bboxes(:,:),annotation);

    % Insert tracking annotations.
    % frameWithAnnotations = insertTrackBoxes(frame, confirmedTracks, positionSelector, d.sensor);

    % Display the annotated frame.    
    videoPlayer(img); 

    cont = hasFrame(videoReader) && isOpen(videoPlayer);

end

如何针对这种车辆检测实施Matlab卡尔曼滤波器?边界框使我可以获得卡尔曼滤波器的参考点。

我找到以下链接:

https://de.mathworks.com/help/vision/ref/vision.kalmanfilter.html https://de.mathworks.com/help/vision/ref/configurekalmanfilter.html

有人可以帮助我使用卡尔曼滤波器吗?

0 个答案:

没有答案