首页 文章

Matlab像素和直方图距离

提问于
浏览
0

是否有任何matlab函数执行以下操作:
enter image description here

NxM是图像的尺寸 . I,j是像素值(红色表示香奈儿1,绿色表示香奈儿2,蓝色表示香奈儿3) .

1 回答

  • 1

    您可以计算第一个距离

    d1 = sqrt(sum((A(:)-B(:)).^2));
    

    和第二个

    % Create histograms
    hA = hist(A(:),255);
    hB = hist(B(:),255);
    
    % Calculate distance
    d2 = sqrt(sum((hA-hB).^2));
    

相关问题