如何从一张256位单色图片中获取这个结果?

huangapple go评论61阅读模式
英文:

How to obtain this result from a 256 bits monochrome picture?

问题

我刚在我正在研究的《数字图像处理》(作者:Rafael C. Gonzalez 和 Richard E. Woods)一书中找到了这张图片:

如何从一张256位单色图片中获取这个结果?

这本书没有解释如何得到这个结果,我想知道如何在其他图片上获得相同的结果。

我在书中找到这张图片的上下文是“使用DFT、WHT和DCT的块变换编码”。
图片附近的文字说:

(a) 一张256位单色图像。
(b)–(h) 图像(a)的四个最重要的二进制和格雷编码的比特平面。

你知道可能有什么方法可以得到这个奇怪的结果吗?

英文:

I just found this image in the book I am studying for Computer Vision (Digital Image Processing by Rafael C. Gonzalez and Richard E. Woods):

如何从一张256位单色图片中获取这个结果?

The book does not explain how to reach this result, and I was wondering how I could reach the same results on other images.

The context in which I found the picture on the book is "block transform coding with the DFT, WHT, and DCT".
The text near the image says:

> (a) A 256-bit monochrome image.
> (b)–(h) The four most significant binary and Gray-coded bit planes of the image in (a).

Do you know any possible way to reach this weird result?

答案1

得分: 2

以下是二进制“位平面”。

如果你对格雷码有疑问,请先了解一下。然后我们可以讨论。其思想与二进制代码并没有太大的不同。

你有一张书页的照片...显示了某个源图像的平面。源图像中的噪音在较低的平面中逐渐变得更加明显。

噪音通过各种复制和打印步骤,就像一个低通滤波器,变成了灰度。这就是为什么只有最高的平面显示相对清晰的边缘和纯黑/白。

请注意,每个平面都被拉伸成全黑或全白。如果我不这样做,你只会得到越来越暗的图片,随着位数的减少。

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?


plane = (im & (1 << k)) # and no scaling by 255

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

英文:

Here are binary "bit planes".

If you have questions on Gray code, please first read up on it. Then we can discuss that. The ideas aren't much different from binary code.

That photo of a book page you have there... shows the planes of some source image. Noise in the source image becomes successively more apparent in the lower planes.

Noise, through various copying and printing steps that act like a lowpass, turns into grayscale. That's why only the highest planes show fairly clean edges and flat black/white.

Note that each plane is stretched to be fully black or white. If I didn't do that, you'd just get ever darker pictures, the further down the bits you go.

im = cv.imread(cv.samples.findFile(&quot;lena.jpg&quot;), cv.IMREAD_GRAYSCALE)

for k in range(8):
    title = f&quot;bit position {k}, value {2**k}&quot;
    plane = ((im &gt;&gt; k) &amp; 1)
    cv.imshow(title, plane * 255)
    cv.waitKey()
    cv.destroyWindow(title)

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?


plane = (im &amp; (1 &lt;&lt; k)) # and no scaling by 255

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

如何从一张256位单色图片中获取这个结果?
如何从一张256位单色图片中获取这个结果?

huangapple
  • 本文由 发表于 2023年6月15日 23:37:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76483318.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定