evalir.m

来自「基于小波变换的特征检索算法」· M 代码 · 共 37 行

M
37
字号
function [r, rs, or] = evalir(rr, mnr)
% EVALIR Evaluate Image Retrieval (IR) performance
%
% Input:
%	rr:	rank of relevant images, one column for each query
%	mnr:	(optional) maximum number of retrieved images considered
%		(default 100)
%
% Output:
%	r:	overall recognition rate
%	rs:	(optional) average recognition rate for each texture class
%	or:	(optional) operating recognition rate in percentage,
%		according to the number of retrieved images considered

[ns, nimages] = size(rr);
pr = zeros(1, nimages);

for q = 1:nimages    
    pr(q) = length(find(rr(:, q) <= ns));
end

r = mean(pr) / ns * 100;

if nargout > 1
    rs = mean(reshape(pr, ns, floor(nimages/ns))) / ns * 100;
end

if nargout > 2
    if nargin < 2
	mnr = 100;
    end
    
    for nr = 1:mnr
	or(nr) = length(find(rr <= (nr+1))) / (ns * nimages) * 100;
    end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?