image-processingcomputer-visionqr-codeinformation-theory

How can I transfer data efficiently via images?


For a customer project I have access to a development and build server via a remote desktop connection. I need to download some build artifacts for local tests, but due to the customer's company wide policy I won't get ssh access or anything useful for file transfer. Via a shared clipboard I can actually copy data (e.g. base 64 encoded), but unfortunately that doesn't seem to work reliably. Having a cheap HDMI to USB video capture device at hand, I figured I could use that to transfer data. At best the device can capture 1080p raw YUV 4:2:2 video, alas the resulting still images are somewhat fuzzy.

So, what algorithm/technology could I use encode/decode the data I want to transfer? Obviously QR codes would work, but the data rate would be fairly poor (a few KB per captured frame -- and due to the not too great RD connection I will only be able to use a frame every few seconds).


Solution

  • After some experimenting I found out that the capture device's color fidelity is far from useful. I tried to encode a data as gray scale pixels, but even repeating each pixel value multiple times didn't result in a captured image from which I could reliably extract the original 8 bit values. Maybe only using the upper 4 bits per gray scale value and repeating the value multiple times would have worked, but finally I ended up with simple black and white images, encoding the same bit in two subsequent pixels. In captured images I haven't experienced a flipped bit yet (as opposed to using one pixel per bit).

    So, this isn't far from using QR codes after all (the elements would have to be 2x1 as well), but the data density is a little higher. I only have a small header with a signature, the image dimensions, and a check sum, so I can easily find an verify the encoded data. I also leave a few pixels to the left an right blank. So per 1080p image I can encode about 125 KiB. This is a lot less than I hoped for, but at least it allows me to transfer data unattended in a reasonable time.