How can two bit masks highlight disagreements?

logical_xor operates on mode-1 images and sets locations marked by exactly one input.

Pixel experiment and interpretation

Agreements disappear. Divide the disagreement count by the evaluated area for a rate. The XOR alone cannot identify which annotator missed a target.

from PIL import Image, ImageChops

def row(values):
    return Image.frombytes('L', (len(values), 1), bytes(values))

a=row([0,255,255]).convert('1')
b=row([255,255,0]).convert('1')
list(ImageChops.logical_xor(a,b).convert('L').tobytes())

Result [255, 0, 255]

中文

怎样标出两份二值标注有分歧的位置?

logical_xor 对模式 1 的图像执行异或,恰有一方置位时输出置位。

像素实验与适用边界

两人都同意的位置会消失。计算分歧率时再除以评估区域大小,不能从异或图判断是谁漏标。

from PIL import Image, ImageChops

def row(values):
    return Image.frombytes('L', (len(values), 1), bytes(values))

a=row([0,255,255]).convert('1')
b=row([255,255,0]).convert('1')
list(ImageChops.logical_xor(a,b).convert('L').tobytes())

结果 [255, 0, 255]

References / 参考来源

Keep reading / 继续阅读