图像相关系数
两幅图像的相关系数求法:
img_a = img_a – MEAN(img_a)
img_b = img_b – MEAN(img_b)
Relation_a_b = r = sum(sum(img_a.*img_b))/sqrt(sum(sum(img_a.*img_a))*sum(sum(img_b.*img_b)));
matlab中corr2可以求解,代码如下:
a = a - mean2(a);
b = b - mean2(b);
r = sum(sum(a.*b))/sqrt(sum(sum(a.*a))*sum(sum(b.*b)));