CMC
CMC全程是Cumulative Matching Characteristics, 是行人重识别问题中的经典评价指标。该曲线的横坐标为rank,纵坐标为识别率百分比。rank n表示识别结果相似性降序排列中前n个结果包含目标。识别率是rank n 的数目#(rank n)占总的query样本数的比例。如下图
CMC曲线图来源 https://blog.csdn.net/m0_37240250/article/details/79942939
代码解释
先贴代码
代码来源 [港中文Xiaogang Wang教授 主页]
function C = cmc(D, varargin) % CMC computes the Cumulative Match Characteristic. % C = CMC(D) computes the CMC of given distance matrix D between each pair % of gallery and probe person. Both gallery and probe persons are % assumed to be unique, i.e., the i-th gallery person matches only to % the i-th probe person. D(i, j) should be the distance between % gallery instance i and probe instance j. % 单个参数C = CMC(D)时表示gallery和probe中的identity都是独一无二的, % 即gallery中第i个person只匹配probe set第i个person % % C = CMC(D, G, P) computes the CMC with G and P are id labels of each % person in gallery and probe sets. D is M*N where M and N are the lengths of % vector G and P, respectively