Can histogram entropy distinguish stripe orientation?

Image entropy measures histogram uncertainty. Identical grayscale counts give identical single-band entropy.

Pixel experiment and interpretation

Rearrange two white and two black points. The entropy stays fixed; inspecting texture direction requires spatial information.

from PIL import Image

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

[row(v).entropy() for v in ([0,255,0,255],[0,0,255,255])]

Result [1.0, 1.0]

中文

相同灰度频数能区分条纹方向吗?

图像熵描述直方图的不确定性,相同灰度频数会得到相同的单通道熵。

像素实验与适用边界

把两个黑点和两个白点重新排列,熵保持一致。检查纹理方向需要读取邻域或空间结构。

from PIL import Image

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

[row(v).entropy() for v in ([0,255,0,255],[0,0,255,255])]

结果 [1.0, 1.0]

References / 参考来源

Keep reading / 继续阅读