先生,你的镜子空间里有一只猫
Sir, there's a cat in your mirror dimension

原始链接: https://lcamtuf.substack.com/p/sir-theres-a-cat-in-your-mirror-dimension

本文讨论频域的概念及其将信号转换为不同的波形表示形式。 可以利用各种波形的频率来代替传统的正弦。 这些变换的两个基本属性包括它们的可逆性和对称性。 这些转换使得能够访问“镜像维度”,其中数据缩减导致视觉上相同的图像。 这一过程称为频域压缩,可显着减少传输或存储所需的数据量。 作者将这一概念应用于猫和女人的图像,将两者在频域中融合,在时域中观看时产生意想不到但令人愉悦的结果。 实验证明了频域压缩的有效性,它可以承受调整大小甚至 JPEG 压缩。 尽管该方法的实际用途可能有限,但它展示了时域和频域之间的独特关系。 如需进一步阅读相关主题,例如电子系统、算法、扫雪机和 19 世纪枪支,请参阅此精选集。

用户讨论图像处理的各个方面,特别关注水印系统和数字图像。 他们提到了使用 Digimarc 水印系统进行实验,指出其对噪声和缩放的抵抗力,但由于图像轻微旋转而失败。 用户推测这可能是由于基于傅立叶变换的算法造成的。 他们对通过将信息转换到频域并将信息合成在图像上来隐藏图像中的信息表示着迷。 用户认为 DCT 和 JPEG2000 使用类似的概念来压缩数据,从而丢弃高频信息。 他们质疑 DCT 在这种情况下如何处理图像,表明它可能不遵循 8x8 图块分割等传统方法。 用户承认从图像中删除所有不需要的信息以确保不保留隐藏水印的挑战。 总的来说,用户探索图像压缩和水印技术背后的理论。
相关文章

原文

A while back, we talked about the frequency domain: a clever reinterpretation of everyday signals that translates them into the amplitudes of constituent waveforms. The most common basis for this operation are sine waves running at increasing frequencies, but countless other waveforms can be used to create a number of alternative frequency domains.

In that earlier article, I also noted two important properties of frequency domain transforms. First, they are reversible: you can recover the original (“time domain” or “spatial domain”) data from its frequency image. Second, the transforms have input-output symmetry: the same mathematical operation is used to go both ways. In effect, we have a lever that takes us to a mirror dimension and back. Which of the lever positions is called home is a matter of habit, not math.

Of course, in real life, the distinction matters — and it’s particularly important for compression. If you take an image, convert it to the frequency-domain representation, and then reduce the precision of (or outright obliterate!) the high-frequency components, the resulting image still looks perceptually the same — but you now have much less data to transmit or store:

This makes you wonder: if the frequency-domain representation of a typical image looks like diffuse noise, if most of it is perceptually unimportant, and if the transform is just a lever that takes us back and forth between two functionally-equivalent dimensions… could we start calling that mirror dimension home and move some stuff in?

To answer this stoner question, I grabbed a photo of a cat and then calculated its frequency-domain form with the discrete cosine transform (DCT):

Next, I reused the photo of a woman from an earlier example and placed the mirror-dimension “cat noise” pattern over it, dialing down opacity to minimize visible artifacts:

The compositing operation is necessarily lossy, but my theory was that if the composite image is run through DCT to compute its frequency-domain representation, the photo of a woman would be decomposed to fairly uniform noise, perhaps easy to attenuate with a gentle blur; while the injected “cat noise” would coalesce into a perceptible image of a cat.

But would it?… Yes!

If you want to see for yourself, download the composite image and have fun. In MATLAB, you can do the following:

woman = imread("woman-with-cat.png");

colormap('gray');
imagesc(woman, [0 255]);
pause(1);

cat = dct2(woman);
imagesc(imgaussfilt(cat, 1), [-4 4]);

Interestingly, the kitty survives resizing of the host document. Upscaling tiles the image; downscaling truncates it.

My lingering question was how badly the cat would get mangled by lossy compression; as it turns out, the impact is less than I expected. At higher JPEG quality settings, the image looks quite OK. As the quality setting is lowered, the bottom right quadrant — corresponding to higher-frequency components — gets badly quantized:

This visualization offers a fascinating glimpse of just how much information is destroyed by the JPEG algorithm — mostly without us noticing.

There’s plenty of prior art for using audio spectrograms for hidden messages, and some discussion of text steganography piggybacked on top of JPEG DCT coefficients. My point isn’t that the technique is particularly useful or that it has absolutely no precedent. It’s just that the frequency domain and the time domain are coupled together in funny ways.

For more articles about electronics, algorithms, snowplowing, and 19th century repeating pistols, see this categorized list.

联系我们 contact @ memedata.com