Go to file
sz 7bb1bc8896 -DBUILD_PORTABLE_LINUX for static linking against opencv and libc++
This gets us back to glibc 2.27 (ubuntu 18.04) -- debian stretch would
be nicer, but the default build tools (c++1x, cmake) gets slightly more
interesting.

The output binaries seem like they could be smaller...
2022-02-19 19:52:04 -06:00
.github/workflows Find clang 2021-04-27 20:26:05 -05:00
bitmap Added some assets to the bitmaps.h file, here they are 2020-08-06 03:06:41 -05:00
samples@ca451805c8 Update submodule rev 2021-02-16 02:57:57 -06:00
src Compile time check is fine, I guess 2022-02-18 20:11:44 -06:00
test new catch2 to make compiler happy 2022-02-17 18:03:44 -06:00
web No PWA for now 2021-06-24 00:28:08 -05:00
.gitignore ok 2020-11-27 18:06:37 -06:00
.gitmodules Ignore local changes to the samples submodule. 2020-08-20 23:43:56 -05:00
CMakeLists.txt -DBUILD_PORTABLE_LINUX for static linking against opencv and libc++ 2022-02-19 19:52:04 -06:00
DETAILS.md Misc docs updates, including new performance numbers! 2021-03-05 07:18:59 -06:00
LICENSE Might as well be license time 2020-05-20 01:45:38 -05:00
PERFORMANCE.md indentation 2021-03-08 01:47:56 -06:00
README.md Update dependency list to single out GLES 2021-04-29 20:04:59 -05:00
TODO.md Misc docs updates, including new performance numbers! 2021-03-05 07:18:59 -06:00
WASM.md Update build instructions to match reality 2021-03-29 16:47:08 -05:00
package-portable-linux.sh -DBUILD_PORTABLE_LINUX for static linking against opencv and libc++ 2022-02-19 19:52:04 -06:00

README.md

INTRODUCTION | ABOUT | CFC | LIBCIMBAR

DETAILS | PERFORMANCE | TODO

libcimbar: Color Icon Matrix Barcodes

Behold: an experimental barcode format for air-gapped data transfer.

It can sustain speeds of 943+ kilobits/s (~118 KB/s) using just a computer monitor and a smartphone camera!

Explain?

The encoder outputs an animated barcode to a computer or smartphone screen:

While the decoder is a cell phone app that uses the phone camera to read the animated barcode:

No internet/bluetooth/NFC/etc is used. All data is transmitted through the camera lens. You can try it out yourself, or take my word that it works. :)

How does it work?

cimbar is a high-density 2D barcode format. Data is stored in a grid of colored tiles -- bits are encoded based on which tile is chosen, and which color is chosen to draw the tile. Reed Solomon error correction is applied on the data, to account for the lossy nature of the video -> digital decoding. Sub-1% error rates are expected, and corrected.

libcimbar, this optimized implementation, includes a simple protocol for file encoding built on fountain codes (wirehair) and zstd compression. Files of up to 33MB (after compression!) are encoded in a series of cimbar codes, which can be output as images or a live video feed. Once enough distinct image frames have been decoded successfully, the file will be reconstructed and decompressed successfully. This is true even if the images are received out of order, or if some have been corrupted or are missing.

Platforms

The code is written in C++, and developed/tested on amd64+linux, arm64+android (decoder only), and emscripten+WASM (encoder only). It probably works, or can be made to work, on other platforms.

Crucially, because the encoder compiles to asmjs and wasm, it can run on anything with a modern web browser. There are releases if you wish to run the encoder locally instead of via cimbar.org.

Library dependencies

OpenCV and GLFW (+ OpenGL ES headers) must be installed before building. All other dependencies are included in the source tree.

Build

  1. install opencv and GLFW. On ubuntu/debian, this looks like:
sudo apt install libopencv-dev libglfw3-dev libgles2-mesa-dev
  1. run the cmake + make incantation
cmake .
make -j7
make install

By default, libcimbar will try to install build products under ./dist/bin/.

To build cimbar.js (what cimbar.org uses), see WASM.

Usage

Encode:

  • large input files may fill up your disk with pngs!
./cimbar --encode -i inputfile.txt -o outputprefix -f

Decode (extracts file into output directory):

./cimbar outputprefix*.png -o /tmp -f

Encode and animate to window:

./cimbar_send inputfile.pdf

You can also encode a file using cimbar.org, or the latest release.

Performance numbers

PERFORMANCE

Implementation details

DETAILS

Room for improvement/next steps

TODO

Inspiration

Would you like to know more?

INTRODUCTION | ABOUT