Giter VIP home page Giter VIP logo

libcimbar's Introduction

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 770+ kilobits/s using nothing but 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 based on fountain codes (wirehair). Files of up to 33MB can be 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 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, and emscripten+wasm. It probably works, or can be made to work, on other platforms.

Library dependencies

OpenCV must be installed before building. All other dependencies are included in the source tree.

Optional:

  • GLFW - https://github.com/glfw/glfw or libglfw3-dev (for when opencv-highgui is not available or unwanted)
    • the GLFW code path also needs/uses GLES3/gl3.h (libgles2-mesa-dev on ubuntu 18.04)

Build

cmake .
make -j7
make install

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

To build the emscripten+WASM encoder (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

Performance numbers

PERFORMANCE

Implementation details

DETAILS

Room for improvement/next steps

TODO

Inspiration

Would you like to know more?

INTRODUCTION | ABOUT

libcimbar's People

Contributors

sz3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.