I don't know if something like that is close to what you have in mind in terms of visualising the differences. As you pointed out, the quantity in which you are interested is a scalar, so there aren't too many options.
RandStream.setDefaultStream(RandStream('mt19937ar','seed',0)); % For reproducibility of results
a = rand(10);
b = rand(10);
A = im2bw(a, graythresh(a));
subplot(2,2,1)
imshow(A, 'InitialMagnification', 'fit')
title('A (ground truth image)')
B = im2bw(b, graythresh(b));
subplot(2,2,2)
imshow(B, 'InitialMagnification', 'fit')
title('B (test image)')
idx_img = find(B);
idx_ref = find(A);
idx_inter = find(A&B);
common_white = zeros(size(A));
common_white(idx_inter) = 1;
subplot(2,2,3)
imshow(common_white, 'InitialMagnification', 'fit')
title('White in both pictures')
dist = 2*length(idx_inter)/(length(idx_ref)+length(idx_img))
idx_img = find(~B);
idx_ref = find(~A);
idx_inter = find(~A&~B);
common_black = ones(size(A));
common_black(idx_inter) = 0;
subplot(2,2,4)
imshow(common_black, 'InitialMagnification', 'fit')
title('Black in both pictures')
dist = 2*length(idx_inter)/(length(idx_ref)+length(idx_img))