Volver al ranking

sz3/libcimbar

C++cimbar.org

Optimized implementation for color-icon-matrix barcodes

opencvbarcodefountain-codesproof-of-conceptimage-hashcpp17
Crecimiento de estrellas
Estrellas
6.2k
Forks
448
Crecimiento semanal
Issues
36
2k4k6k
feb 2023mar 2024may 2025jul 2026
README

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 850 kilobits/s (~106 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. For offline use, you can either install cimbar.org as a progressive web app, or download the latest release of cimbar_js.html, save it locally, and open it in your web browser.

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

Decode (extracts file into output directory):

./cimbar outputprefix*.png -o /tmp

Decode a series of encoded images from stdin:

echo outputprefix*.png | ./cimbar -o /tmp

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

Community Tools

  • cimbar-bigfile — A pure-frontend wrapper that splits files into multiple parallel encode_id streams (10–15 MB chunks per stream), and ships a manifest.json for SHA256-verified reassembly. Supports 100+ MB files. No changes to libcimbar or cfc required.

Inspiration

Would you like to know more?

INTRODUCTION | ABOUT

Repositorios relacionados
opencv/opencv

Open Source Computer Vision Library

C++Apache License 2.0opencvc-plus-plus
opencv.org
90.1k56.9k
CMU-Perceptual-Computing-Lab/openpose

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation

C++Otheropenposecomputer-vision
cmu-perceptual-computing-lab.github.io/openpose
34.3k8k
spmallick/learnopencv

Learn OpenCV : C++ and Python Examples

Jupyter Notebookcomputer-visionmachine-learning
learnopencv.com
23k11.7k
memvid/memvid

Memory layer for AI Agents. Replace complex RAG pipelines with a serverless, single-file memory layer. Give your agents instant retrieval and long-term memory.

Rustcrates.ioApache License 2.0aicontext
memvid.com
16k1.4k
vipstone/faceai

一款入门级的人脸、视频、文字检测以及识别的项目.

PythonPyPIMIT Licensedlibopencv
11.1k2.5k
go-vgo/robotgo

RobotGo, Go Native cross-platform RPA, GUI automation, Auto test and Computer use @vcaesar

GoGo ModulesApache License 2.0gorobot
atomai.cc
10.7k958
openframeworks/openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.

C++Otheropenframeworksosx
openframeworks.cc
10.4k2.6k
opencv/opencv_contrib

Repository for OpenCV's extra modules

C++Apache License 2.0opencv
10.1k5.9k
Ewenwan/MVision

机器人视觉 移动机器人 VS-SLAM ORB-SLAM2 深度学习目标检测 yolov3 行为检测 opencv PCL 机器学习 无人驾驶

C++machine-visioncnn
8.7k2.8k
bytedeco/javacv

Java interface to OpenCV, FFmpeg, and more

JavaMavenOtherjavacvjava
8.3k1.6k
vietnh1009/ASCII-generator

ASCII generator (image to text, image to image, video to video)

PythonPyPIMIT Licenseasciiascii-art
8.3k651
hybridgroup/gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.

GoGo ModulesOtheropencvgolang
gocv.io
7.5k903