| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=39087752
为了具体回答您的问题,这里简要概述了如何将原始二维码图像转换为二进制数据: 1. 将二维码图像加载到首选图像处理工具(例如 ImageMagick 或 OpenCV,或 Python 库 Pillow 或 Scikit-Image)中。 2. 将彩色图像转换为灰度图像(可选)。 3. 执行各种过滤技术(例如高斯模糊或中值过滤)以消除噪声、锐化边缘并增强对比度。 4. 应用腐蚀、膨胀等形态学操作进一步清理二维码数据。 5. 结合使用边缘检测算法和连通分量分析来识别各个模块边界。 6. 从识别的区域中提取二进制模块数据。 7. 解码提取的二进制模块数据。 总的来说,实现此功能需要图像处理和编程方面的基本知识,但它在像您之前描述的情况下会很有帮助。 此外,这种转换技术允许处理具有非理想特性的打印或绘制的 QR 码。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
So I ended up writing a Basic program on the Atari to read data from the disk sector by sector and paint it on the screen (with the large 4-color pixels of graphics mode 3). The Atari was connected to the TV card of my PC and a Delphi program I wrote was running on the PC that kept taking screen shots and trying to decode the data from there. I quickly learned that empty sectors threw off my pixel position calibration so I added a mask pattern and a checksum. The sector address was also included. With that, I was able to transfer all my disk contents to my PC. To this day I consider it my greatest engineering achievement :)
Some ten years later, I went on to build an SIO2PC program called AspeQt. A more up-to-date community fork called RespeQt is still the most popular tool in that category used by the community. It even has its own subforum on AtariAge[1].
[1] https://forums.atariage.com/forum/184-respeqt-sio2pc-softwar...
reply