Barcode Reader System Using Image Processing Matlab
Barcode Reader System Using Image Processing Matlab
Barcode Reader System Using Image Processing Matlab
Matlab
Iwan Panjaitan
Zepanya Banjarnahor Willy Simangunsong
Department of Electrical Engineering
Department of Electrical Engineering Department of Electrical Engineering
Del Institute of Technology
Del Institute of Technology Del Institute of Technology
Laguboti, Sumatera Utara, Indonesia
Laguboti, Sumatera Utara, Indonesia Laguboti, Sumatera Utara, Indonesia
Abstract—This paper acquires code 39 barcode image from only the products themselves, but also outgoing
user, reads the barcode and outputs the result. The method to shipments and even equipment.
perform this operation is with image processing, in order to get
an enhanced image or to extract some information from it. It is 5. Inventory control improves. Because barcodes
a type of signal processing in which input is an image and make it possible to track inventory so precisely,
output may be image or characteristics/features associated inventory levels can be reduced. This translates into
with that image. This work proposes a method for the detection a lower overheard. The location of equipment can
and identification of code 39 barcode that will help in also be tracked, reducing the time spent searching
industrial field. This paper presents an approach based on for it, and the money spent replacing equipment that
simple but efficient morphological operation. This approach is is presumed lost.
simplified to segmented all the letters and numbers used in the
barcode by apply threshold method. After converting image in 6. Barcodes provide better data. Since one barcode can
to greyscale mode, apply threshold method to generate a be used for inventory and pricing information, it is
binary sequence so numbers and characters can be present in possible to quickly obtain data on both.
output, all information from the barcode can be used to Furthermore, barcodes can be customized to contain
industry field. other relevant information as needed. They provide
fast, reliable data for a wide variety of applications.
Keywords—code 39, threshold, binary
7. Data obtained through barcodes is available rapidly.
Since the information is scanned directly into the
I. INTRODUCTION central computer, it is ready almost instantaneously.
A barcode (also bar code) is an optical, machine- This quick turnaround ensures that time will not be
readable representation of data; the data usually describes wasted on data entry or retrieval.
something about the object that carries the barcode.
8. Barcodes promote better decision making. Because
Traditional barcodes systematically represent data by varying
data is obtained rapidly and accurately, it is possible
the widths and spacing of parallel lines, and may be referred
to make more informed decisions. Better decision
to as linear or one-dimensional (1D). Later, two-dimensional
making ultimately saves both time and money.
(2D) variants were developed, using rectangles,
dots, hexagons and other geometric patterns, called matrix In this modern world some of barcode usage we can found
codes or 2D barcodes, although they do not use bars as such. on:
Initially, barcodes were only scanned by special optical
scanners called barcode readers. Later application - Admission tickets in movie theaters, events, and
software became available for devices that could read travel
images, such as smartphones with cameras. Design program - Advertising
by using MATLAB and other suitable software on barcode
reading. The Image Processing Toolbox extends the basic - Tracking food intake or products
capabilities of MATLAB by providing a number of
specialized I/O, display, and processing functions for images
and image processing. On this paper type of barcode that we use is 39 code
barcode (One-dimensional). The Code 39 specification
Barcodes are often overlooked as a method for cutting defines 43 characters, consisting of uppercase letters (A
costs and saving time. A valuable and viable choice for through Z), numeric digits (0 through 9) and a number of
businesses looking to improve efficiency and reduce special characters (-, ., $, /, +, %, and space). An additional
overhead, barcodes are both cost-effective and reliable. character (denoted '*') is used for both start and stop
1. Barcodes eliminate the possibility of human error. delimiters. Each character is composed of nine elements: five
The occurrence of errors for manually entered data bars and four spaces. Three of the nine elements in each
is significantly higher than that of barcodes. A character are wide (binary value 1), and six elements are
barcode scan is fast and reliable, and takes infinitely narrow (binary value 0). The width ratio between narrow and
less time than entering data by hand. wide is not critical, and may be chosen between 1:2 and 1:3.
Their original design included two wide bars and one wide
space in each character, resulting in 40 possible characters.
Setting aside one of these characters as a start and stop
pattern left 39 characters, which was the origin of the name
Code 39. Four punctuation characters were later added, using
no wide bars and three wide spaces, expanding the character
set to 43 characters. Those are the reason why we choose 39
code barcode type to be implemented in this project. This step is just to anticipated if users input the low
quality’s barcode.
c. Generate Binary Sequence
Level = graythresh(Barcode)
ThresholdBarcode=im2bw(Barcode,0.65);
1. NIM barcode
IV. CONCLUSION
In this paper, details of the implementation multiple
The proof:
detection of barcodes by encoding and decoding data based
on Matlab as well as simulation results are provided. We
have presented an algorithm for decoding (localization and
reading) barcodes through a webcam, using image-
processing techniques such as filtering, cropping, and
contrast enhancement and edge detection. This localization
technique is fast and accurate even for cluttered images.
Barcodes having a flat surface and a width to height ratio
between 2 to 3 are successfully decoded. We have
implemented this algorithm in MATLAB R2014b. We have
scanned multiple products by executing this algorithm in a
loop, and a final bill of products is created in an excel sheet.
REFERENCES