Package boofcv.alg.fiducial.qrcode
Class ReedSolomonCodes_U8
java.lang.Object
boofcv.alg.fiducial.qrcode.ReedSolomonCodes_U8
TODO Summarize
Code and code comments based on the tutorial at [1].
[1] Reed-Solomon Codes for Coders Viewed on September 28, 2017
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
computeECC
(DogArray_I8 input, DogArray_I8 output) Given the input message compute the error correction code for itboolean
correct
(DogArray_I8 input, DogArray_I8 ecc) Decodes the message and performs any necessary error correctionboolean
findErrorLocations_BruteForce
(DogArray_I8 errorLocator, int messageLength, DogArray_I32 locations) Creates a list of bytes that have errors in themvoid
generator
(int degree) Creates the generator function with the specified polynomial degree.int
Number of bit errors
-
Constructor Details
-
ReedSolomonCodes_U8
public ReedSolomonCodes_U8(int numBits, int primitive, int generatorBase) - Parameters:
numBits
- Number of bits in each wordprimitive
- Primitive polynomialgeneratorBase
- Base for generator polynomial. 0 or 1
-
-
Method Details
-
computeECC
Given the input message compute the error correction code for it- Parameters:
input
- Input message. Modified internally then returned to its initial stateoutput
- error correction code
-
correct
Decodes the message and performs any necessary error correction- Parameters:
input
- (Input) Corrupted Message (Output) corrected messageecc
- (Input) error correction code for the message- Returns:
- true if it was successful or false if it failed
-
findErrorLocations_BruteForce
public boolean findErrorLocations_BruteForce(DogArray_I8 errorLocator, int messageLength, DogArray_I32 locations) Creates a list of bytes that have errors in them- Parameters:
errorLocator
- (Input) Error locator polynomial. Coefficients from small to large.messageLength
- (Input) Length of the message + ecc.locations
- (Output) locations of bytes in message with errors.
-
generator
public void generator(int degree) Creates the generator function with the specified polynomial degree. The generator function is composed of factors of (x-a_n) where a_n is a power of 2.
if generatorFamily = 0 then:
g4(x) = (x - α0) (x - α1) (x - α2) (x - α3) = 01 x4 + 0f x3 + 36 x2 + 78 x + 40- Parameters:
degree
- Number of words in ECC. Larger values mean more error correction
-
getTotalErrors
public int getTotalErrors()Number of bit errors
-