FOR QR CODE
Install libdecodeqr-examples from the repositories,
Use the program, libdecodeqr-simpletest provided by the package to read your QR encoded image
EXAMPLE:
running this command to read one of the test samples in the examples img folder
libdecodeqr-simpletest /usr/share/doc/libdecodeqr-examples/img/debian.or.jp.qr.jpg
Gives the decoded output in the console.
libdecodeqr version 0.9.3 ($Rev: 42 $)
STATUS=2080
http://www.debian.or.jp
MEBKM:TITLE:DebianJP;URL:http\://www.debian.or.jp;;
as can be seen a url was encoded in the file
There is also a sample application that works with your webcam called libdecodeqr-webcam
you need a webcam to use this, I have not tested it.
IF you would like to generate QR code you can install qrencode from the repositories.
cat input.txt | qrencode -s 10 -o test.png
The above will encode the information in the input.txt file in an image file called test.png.
or you can input text from the console with;
qrencode -s 10 -o ubuntu.png http://www.ubuntu.com
The above will generate a QR encoded image called ubuntu.png with the url http://www.ubuntu.com encoded in it.
FOR DATAMATRIX
Install libdmtx-utils from the repository and try using the tools it provides.
Libdmtx is a library for reading and writing Data Matrix 2D barcodes,
two-dimensional symbols that hold a dense pattern of data with built-in error
correction.
dmtxwrite - create Data Matrix barcodes, simple example;
dmtxwrite -o image.png input.txt
This will encode text contained in input.txt in current directory to an image, image.png in current directory.
dmtxread - scan Data Matrix barcodes, simple example;
dmtxread image.png
Reads the encoded image.png and writes the decoded messages to
standard output.