• 大小: 30.04MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-07-05
  • 语言: Matlab
  • 标签: 帧差法  

资源简介

非常完整的帧差法多目标跟踪Matlab代码,并提供了完整的文档介绍,非常适合初学者学习。注:运行时要改一下文件路径,以及把视频文件转成图像序列(代码可百度)输入。

资源截图

代码片段和文件信息

function TempD = CmbArea(D)
%主要思想:现将各连通域进行一定的扩大,然后通过比较四界之二是否被包括来判断连通域是否发生重叠
%%%临近区域合并(但是力度不应过大)
TempD = struct(‘BoundingBox‘{}‘Centroid‘{});
TNum = 0;
flag = 0;
SS1 = 0;  %% 列
SS3 = 0; %% 行
SS2 = 0;
SS4 = 0;
th1 = 3;   %% 列
th2 = 12;   %% 行
th3 = 18;
th4 = 23;
for i=1:size(D2)
    if TNum==0 %% 没有目标
        TNum = TNum + 1;
        TempD(TNum).BoundingBox = D(i).BoundingBox; %%%%存储
        TempD(TNum).Centroid = D(i).Centroid;
    else  %% 已经存在目标
        for j=1:TNum %% 存在目标的信息
            if D(i).Centroid(1)<155
                SS1 = th1;
                SS3 = th2;
            else
                SS1 = th3;
                SS3 = th4;
            end
            if TempD(j).Centroid(1)<155
                SS2 = th1;
                SS4 = th2;
            else
                SS2 = th3;
                SS4 = th4;
            end
            x1 = D(i).BoundingBox(1)-SS1; %%列
            x2 = D(i).BoundingBox(2)-SS3;
            x3 = D(i).BoundingBox(1) + D(i).BoundingBox(3)+SS1; %% 列
            x4 = D(i).BoundingBox(2) + D(i).BoundingBox(4)+SS3;
            y1 = TempD(j).BoundingBox(1)-SS2; %%列
            y2 = TempD(j).BoundingBox(2)-SS4;
            y3 = TempD(j).BoundingBox(1) + TempD(j).BoundingBox(3)+SS2;%%列
            y4 = TempD(j).BoundingBox(2) + TempD(j).BoundingBox(4)+SS4;
            if ((x1y1) || (x1y3)) &&  ( (x2y2) || (x2y4)) %% 条件成立,判定为同一目标(合并信息)
%                 TempD(j).Centroid = (TempD(j).Centroid + D(i).Centroid)/2;
                temp1 = max((TempD(j).BoundingBox(1)+TempD(j).BoundingBox(3))  (D(i).BoundingBox(1)+D(i).BoundingBox(3)));
                temp2 = max((TempD(j).BoundingBox(2)+TempD(j).BoundingBox(4))  (D(i).BoundingBox(2)+D(i).BoundingBox(4)));
                TempD(j).BoundingBox(1) = min(TempD(j).BoundingBox(1)D(i).BoundingBox(1));
                TempD(j).BoundingBox(2) = min(TempD(j).BoundingBox(2)D(i).BoundingBox(2));
                TempD(j).BoundingBox(3) = temp1 - TempD(j).BoundingBox(1);
                TempD(j).BoundingBox(4) = temp2 - TempD(j).BoundingBox(2);
                TempD(j).Centroid(1) = TempD(j).BoundingBox(1) + TempD(j).BoundingBox(3)/2;
                TempD(j).Centroid(2) = TempD(j).BoundingBox(2) + TempD(j).BoundingBox(4)/2;
                flag = 1;
                break;
            end
            if ((y1x1) || (y1x3)) &&  ( (y2x2) || (y2x4)) %% 条件成立,判定为同一目标(合并信息)
%                 TempD(j).Centroid = (TempD(j).Centroid + D(i).Centroid)/2;
                temp1 = max((TempD(j).BoundingBox(1)+TempD(j).BoundingBox(3))  (D(i).BoundingBox(1)+D(i).BoundingBox(3)));
                temp2 = max((TempD(j).BoundingBox(2)+TempD(j).BoundingBox(4))  (D(i).BoundingBox(2)+D(i).BoundingBox(4)));
                TempD(j).BoundingBox(1) = min(TempD(j).BoundingBox(1)D(i).BoundingBox(1));
                TempD(j).BoundingBox(2) = min(TempD(j).BoundingBo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         59  2014-01-31 09:14  vlfeat-0.9.18\.gitattributes

     文件        700  2014-01-31 09:14  vlfeat-0.9.18\.gitignore

     文件      11594  2014-01-31 09:14  vlfeat-0.9.18\apps\phow_caltech101.m

     文件       5278  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\encodeImage.m

     文件       6905  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\experiments.m

     文件        822  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\extendDescriptorsWithGeometry.m

     文件       1679  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\getDenseSIFT.m

     文件        919  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\readImage.m

     文件       2495  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\setupCaltech256.m

     文件       1197  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\setupFMD.m

     文件       4024  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\setupGeneric.m

     文件       2368  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\setupScene67.m

     文件       5189  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\setupVoc.m

     文件       6226  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\trainEncoder.m

     文件       6097  2014-01-31 09:14  vlfeat-0.9.18\apps\recognition\traintest.m

     文件       4621  2014-01-31 09:14  vlfeat-0.9.18\apps\sift_mosaic.m

     文件       8396  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\aib

     文件     293498  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\libvl.so

     文件      21717  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\mser

     文件      26345  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\sift

     文件       8327  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_gauss_elimination

     文件       8597  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_getopt_long

     文件      13455  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_gmm

     文件      12462  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_heap-def

     文件       8345  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_host

     文件       8611  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_imopv

     文件       8500  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_kmeans

     文件       8389  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_liop

     文件      12490  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_mathop

     文件       8450  2014-01-31 09:14  vlfeat-0.9.18\bin\glnx86\test_mathop_abs

............此处省略2012个文件信息

评论

共有 条评论