Tuesday 26 May 2015

BAR Codes & QR Codes

Report

1D & 2D BARCODE

DEFINITION
A barcode is an optical machine/computer readable representation of data relating to the object to which it is attached. A 1D (linear) code is the typical "picket fence" style barcode that people are most familiar with. There are several versions of 1D codes and some encode only numbers while others can encode any keyboard character. All the information in the code is organized horizontally from left to right. These types of codes can be read by any type of barcode scanner. 2D barcodes are a bit more complex as they organize information vertically and horizontally. This allows 2D codes to hold much more information and take up less space than a 1D code. 2D codes require an image scanner to be read properly.

TYPES
One dimensional (1D) barcodes have many different types e.g. Codes 128, Code 39, UPC etc. Whereas two dimensional (2D) also have many types e.g. Data Matrix, PDF417, and QR Code etc.




WORKING
A barcode essentially is a way to encode information in a visual pattern that a machine can read. The combination of black and white bars (elements) represents different text characters which follows a set algorithm for that barcode type. If you change the sequence of elements you get different text. A barcode scanner reads this pattern of black and white that is then turned into a line of text your computer can understand. Usually it has product information like name, type etc. and system matches the product to database and get any required information.
Depending on the specific barcode type, 1D barcodes can have from 20-25 characters while 2D codes go up to 2,000 characters. The main practical concern is that as you increase the amount of information in the barcode the bigger it will become. 


The number of digits is determined by how many products you will need to assign numbers to. So if you have thousands of products, your company prefix will need to be fewer digits. If you have just a few products, your company prefix will likely be closer to 10 digits long. The second component is your unique number used to reference a specific product. It is called an "Item Reference Number.


QR code
QR (quick response) code a machine-readable code also known as 2D barcode consisting of an array of black and white squares, typically used for storing URLs or other information for reading by the camera on a smartphone. Unlike UPC barcode which are horizontal lines, a QR code can be captured more quickly and can contain more information.


QR code are intended to be a quick way to perform an action with your phone. Anyone can make QR code from many different websites like:
And many more.


WORKING
QR codes are made up of black squares and white squares. Each of these squares is called a module. In every QR code, there are certain modules that must not be covered or edited.

·         The three large squares highlighted in red are the position markers. These tell the scanner where the edges of the code are.
·         The smaller red square is an alignment marker. This acts as a reference point for the scanner, making sure everything lines up properly. In bigger codes, there are several of these squares.
·         The red strips of alternating black and white modules are called timing patterns. They define the positioning of the rows and columns.
·         The green sections determine the format. This tells the scanner whether it’s a website, text message, Chinese symbols, numbers, or any combination of these.
·         The modules highlighted in blue represent the version number. Basically, the more modules in the code, the higher the version (up to v40, which is 177×177 modules). If the code is version 6 or smaller, the version does not need to be defined here because the scanner can literally count the modules and determine the version on its own.


·         Now everything else is free for us. Almost all the remaining modules are grouped into 8 modules. These groups are known as bytes, they fit together in the grey area.
·         When a smartphone or scanner reads a QR code, each byte is determined to be either completely readable or completely un-readable. That means that if you change one single module (e.g. turning a black square into a white square), the entire byte containing that module is rendered un-readable.
The table will give you a letter that represents the level of error-correction contained in your code. Here’s what these letters mean:
·         Level L – You can alter up to 7% of the code without ruining its scan-ability. If your code has 154 bytes, you can edit 10 (maybe 11) bytes and it will still scan successfully.
·         Level M – You can alter up to 15% of the code.
·         Level Q – You can alter up to 25% of the code.
·         Level H – You can alter as much as 30% of your code.
So now you should be able to do the following:
-          Generate a QR code
-          Identify the No-Zones
-          Figure out the placement of the bytes
-          Figure out how many bytes you can edit


JAVA API:
Here is the most famous open source java library to generate QR code.


REFERENCES:


No comments:

Post a Comment