问题描述
在维基百科的隐写术文章中,有一个示例图像,其中包含隐藏的图像数据. /p>
维基百科注释:
问题::我对后续规范化"感到困惑;假设基于PIL模块的Python 2.x代码正常工作,归一化如何影响检索?
后续规范化为线性插值每个颜色成分的a>.
说,像素1,1的红色分量是234.
234的二进制表示形式是
In [1]: bin(234)
Out[1]: '0b11101010'
我们可以通过按位操作删除除最低两位以外的所有内容:
In [2]: bin(234 & 0b11)
Out[2]: '0b10'
8位图像的范围是8位或256个可能的阴影.但是我们的颜色值范围只有2位或4种可能的阴影.
归一化部分正在进行线性插值以拉伸2位值以填充8位空间:
In [3]: (234 & 0b11) * (256/4)
Out[2]: 128
在每个颜色组件上执行此操作,猫就会出现.
At Wikipedia's Steganography Article there is an example image given with hidden image data.
Wikipedia notes:
QUESTION: I'm confused about "subsequent normalisation"; assuming working Python 2.x code based on PIL module, how does normalisation factor into the retrieval?
The subsequent normalization is linear interpolation of each color component.
Say, the the red color component of pixel 1,1 is 234.
The binary representation of 234 is
In [1]: bin(234)
Out[1]: '0b11101010'
We can remove everything but the two least significant bits with some bitwise operation:
In [2]: bin(234 & 0b11)
Out[2]: '0b10'
The range of a 8-bit image is 8-bits or 256 possible shades. But the range of our color value is just 2-bits or 4 possible shades.
The normalization part is doing linear interpolation to stretch the 2-bit value to fill 8-bit space:
In [3]: (234 & 0b11) * (256/4)
Out[2]: 128
Do this is done on each color component and the cat would appear.
这篇关于使用Python解码隐写术图像(Wikipedia上的示例图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!