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