Skip to content

Jimbopython/sfdm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sfdm - Simple, fast datamatrix

sfdm is a library which targets to provide a fast, accurate and easy to use datamatrix code reader.

Usage

There are three implementations to choose from:

A code reader based on ZXing, a code reader based on libdmtx and a combination of both.

ZXing code reader

#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::ZXingCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';

libdmtx code reader

#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::LibdmtxCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';

Combined code reader

#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::LibdmtxZXingCombinedCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';

How to build

The sfdm library needs ZXing or libdmtx or both as dependency. The recommended way is to build dependencies with conan. The conan file is provided here.

Build instructions

Change directory into root of this repository.

In order to build the sfdm library without conan use the following (dependencies must be present):

cmake -B build -S .
cmake --build build

To build the sfdm library with conan use the following:

cmake --preset=conan-<build_type>
cmake --build --preset=conan-<build_type>

Detection results & Performance

Detection results

Performance