如何实现中心位置错误(CLE)代码

时间:2018-01-11 15:38:58

标签: matlab

我试着写出对应于这个公式的哪个,哪一个是正确的我是毕业的任何帮助 我加载了groundtruth变量和结果,它们也是这种形式的txt文件[x,y,w,h] = 100,22,12,32

enter image description here

filename_groundtruth = 'D:\data_seq\david2\anno\groundtruth_rect.txt';
[groundtruth,delimiterOut]=importdata(filename_groundtruth);
filename_result = 'D:\data_seq\david2\anno\result_rect.txt';
[output_result,delimiterOut]=importdata(filename_result);

Nrg=size(groundtruth,1); %number of images
cle = 0;% The Center Location Error
for i=1 : Nrg
    xg = groundtruth(i,1);
    yg = groundtruth(i,2);
    xr = output_result(i,1);
    yr = output_result(i,2);

    % formula 1
    cle = cle+ (1/Nrg)*sqrt((xg-xr).^2+(yg-yr).^2);

end

cle

filename_groundtruth = 'D:\data_seq\david2\anno\groundtruth_rect.txt';
[groundtruth,delimiterOut]=importdata(filename_groundtruth);
filename_result = 'D:\data_seq\david2\anno\result_rect.txt';
[output_result,delimiterOut]=importdata(filename_result);

Nrg=size(groundtruth,1); %number of images
cle = 0;% The Center Location Error
for i=1 : Nrg
    xg = groundtruth(i,1);
    yg = groundtruth(i,2);
    xr = output_result(i,1);
    yr = output_result(i,2);


 % formula 2
     cle = cle+ sqrt((xg-xr).^2+(yg-yr).^2);
end
cle = (1/Nrg)*cle;

cle

0 个答案:

没有答案