Image Component Library (ICL)
|
Main class for BCH encoding/decoding. More...
#include <BCHCode.h>
Public Member Functions | |
BCHCoder () | |
Default constructor. More... | |
~BCHCoder () | |
Destructor. More... | |
DecodedBCHCode | decode (const BCHCode &code) |
DecodedBCHCode | decode (const icl8u data[36]) |
decodes given (correctly oriented) byte image patch More... | |
DecodedBCHCode | decode (const core::Img8u &image, bool useROI=true) |
decodes given (correctly oriented) core::Img8u (optionally using its ROI or not) More... | |
DecodedBCHCode2D | decode2D (const core::Img8u &image, int maxID=4095, bool useROI=true) |
decodes given core::Img8u (optionally using its ROI or not) More... | |
Static Public Member Functions | |
static BCHCode | encode (int idx) |
encodes a given index in range [0,4095] to a BCHBinary code More... | |
static core::Img8u | createMarkerImage (int idx, int border=2, const utils::Size &resultSize=utils::Size::null) |
creates an image that show a given bch marker More... | |
static BCHCode | rotateCode (const BCHCode &in) |
interpretes the given 36Bit as 6x6 image and rotates it by clock wise by 90 degree More... | |
Private Attributes | |
Impl * | impl |
internal implementation structure More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
Main class for BCH encoding/decoding.
Due to some internal buffers, this must be implemented as a class
icl::markers::BCHCoder::BCHCoder | ( | ) |
Default constructor.
icl::markers::BCHCoder::~BCHCoder | ( | ) |
Destructor.
|
static |
creates an image that show a given bch marker
idx | which marker |
border | amount of border pixels (here, we use the unit of marker pixels, the maker code is always 6x6 marker pixels) |
resultSize | first a (2*border+6)x(2*border+6) image of the marker is created. Then it is upscaled to the given utils::Size using nearest neighbour interpolation. If resultSize is null, the (2*border+6)x(2*border+6) image is returned directly without upscaling |
DecodedBCHCode icl::markers::BCHCoder::decode | ( | const BCHCode & | code | ) |
We use an error correcting 36Bit BCH code that carries 12 bit of information (i.e. each possible code is associated with a unique index (0 <= index <= 4095). The code provides automatic error correction for inputs that have not more than 4 errors. Its minimal hammin distance is 8. The higher the code indices, the lower their hamming distance:
Decoding works quite fast, however the decoder works slightly slower if errors have to be corrected. We benchmarked the BCHDecoder on an Intel(R) Xeon(R) CPU E5530 running at 2.40GHz, on 32Bit Ubuntu Linux. Decoding without errors (2ns) Decoding with 1,2 and 3 errors (3ns) Decoding with 4 errors (4ns)
We used the code implemented by Robert Morelos-Zaragoza. You can find his copyright note in the corresponding .cpp file
DecodedBCHCode icl::markers::BCHCoder::decode | ( | const icl8u | data[36] | ) |
decodes given (correctly oriented) byte image patch
DecodedBCHCode icl::markers::BCHCoder::decode | ( | const core::Img8u & | image, |
bool | useROI = true |
||
) |
decodes given (correctly oriented) core::Img8u (optionally using its ROI or not)
DecodedBCHCode2D icl::markers::BCHCoder::decode2D | ( | const core::Img8u & | image, |
int | maxID = 4095 , |
||
bool | useROI = true |
||
) |
decodes given core::Img8u (optionally using its ROI or not)
Internally, this methods checks for all 4 possible image rotations and returns the most plausible result.
If we allow rotations, the expected inter-marker hamming distances gets smaller.
please note that it's best to use the first N IDs if you want to use N markers
|
static |
encodes a given index in range [0,4095] to a BCHBinary code
interpretes the given 36Bit as 6x6 image and rotates it by clock wise by 90 degree
|
private |
internal implementation structure
implementation pointer