QR Code Recognition Based On Image Processing
QR Code Recognition Based On Image Processing
ARTICLEINFO ABSTRACT
To solve the QR code recognition problem caused by ordinary camera
Article History:
collection, the recognition algorithm based on image processing is put
Accepted: 03 March 2024
forward in this paper. The whole process including image binarization,
Published: 13 March 2024
image tilt correction, image orientation, image geometric correction and
image normalization allows images collected on different illumination
conditions. Experiments show that the improved method can enhance the
Publication Issue :
recognition speed of two-dimensional code and accuracy.
Volume 11, Issue 2
QR i.e. “Quick Response” code is a 2D matrix code that is designed by
March-April-2024
keeping two points under consideration, i.e. it must store large amount of
Page Number :
data as compared to 1D barcodes and it must be decoded at high speed
160-168
using any handheld device like phones. QR code provides high data
storage capacity, fast scanning, omnidirectional readability, and many
other advantages including, error-correction (so that damaged code can
also be read successfully) and different type of versions. Different varieties
of QR code symbols like logo QR code, encrypted QR code, QR Code are
also available so that user can choose among them according to their need.
Now these days, a QR code is applied in different application streams
related to marketing, security, academics etc. and gain popularity at a
really high pace. Day by day more people are getting aware of this
technology and use it accordingly. The popularity of QR code grows
rapidly with the growth of smartphone users and thus the QR code is
rapidly arriving at high levels of acceptance worldwide.
Keywords : QR code, 2D matrix code, encrypted QR code
Copyright © 2024 The Author(s): This is an open-access article distributed under the terms of the Creative 160
Commons Attribution 4.0 International License (CC BY-NC 4.0) which permits unrestricted use, distribution,
and reproduction in any medium for non-commercial use provided the original author and source are credited.
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 161
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
performance from experiences, and predict things The system creates a model using labelled data to
without being explicitly programmed”. understand the datasets and learn about each data,
A Machine Learning system learns from historical once the training and processing are done then we
data, builds the prediction models, and whenever it test the model by providing a sample data to check
receives new data, predicts the output for it. The whether it is predicting the exact output or not.
accuracy of predicted output depends upon the The goal of supervised learning is to map input data
amount of data, as the huge amount of data helps to with the output data. The supervised learning is based
build a better model which predicts the output more on supervision, and it is the same as when a student
accurately. learns things in the supervision of the teacher. The
Suppose we have a complex problem, where we need example of supervised learning is spam filtering.
to perform some predictions, so instead of writing a
code for it, we just need to feed the data to generic Supervised learning can be grouped further in two
algorithms, and with the help of these algorithms, categories of algorithms:
machine builds the logic as per the data and predict
the output. Machine learning has changed our way of • Classification
thinking about the problem. The below block diagram • Regression
explains the working of Machine Learning algorithm:
2) Unsupervised Learning
Unsupervised learning is a learning method in which
a machine learns without any supervision. The
training is provided to the machine with the set of
data that has not been labelled, classified, or
categorized, and the algorithm needs to act on that
2.1.1. Features of Machine Learning: data without any supervision. The goal of
• Machine learning uses data to detect various patterns unsupervised learning is to restructure the input data
in a given dataset. into new features or a group of objects with similar
• It can learn from past data and improve patterns.
automatically. In unsupervised learning, we don't have a
• It is a data-driven technology. predetermined result. The machine tries to find useful
• Machine learning is much similar to data mining as insights from the huge amount of data.
it also deals with the huge amount of the data. It can be further classifieds into two categories of
2.1.2. Classification of Machine Learning algorithms:
At a broad level, machine learning can be classified
into three types: • Clustering
1. Supervised learning • Association
2. Unsupervised learning
3. Reinforcement learning Algorithms:
1) Supervised Learning Opencv
Supervised learning is a type of machine learning OpenCV (Open-Source Computer Vision Library) is
method in which we provide sample labelled data to an open-source software library for computer vision
the machine learning system in order to train it, and and machine learning. OpenCV was created to
on that basis, it predicts the output. provide a shared infrastructure for applications for
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 162
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
computer vision and to speed up the use of machine feedback and once it passes the approval of the
perception in consumer products. OpenCV, as a BSD- reviewer, it will be merged to OpenCV. Then you
licensed software, makes it simple for companies to become a open source contributor. Similar is the case
use and change the code. There are some predefined with other tutorials, documentation etc. As new
packages and libraries that make our life simple and modules are added to OpenCV-Python, this tutorial
OpenCV is one of them. will have to be expanded. So those who knows about
Gary Brad sky invented OpenCV in 1999 and soon the particular algorithm can write up a tutorial which
first release came in 2000. This library is based on includes a basic theory of the algorithm and a code
optimised C / C++ and supports Java and Python along showing basic usage of the algorithm and submit it to
with C++ through an interface. The library has more OpenCV
than 2500 optimised algorithms, including an
extensive collection of computer vision and machine II. LITERATURE REVIEW
learning algorithms, both classic and state-of-the-art.
Using OpenCV it becomes easy to do complex tasks [1]Title: QR Code Recognition based on Principal
such as identify and recognise faces, identify objects, Components Analysis Method
classify human actions in videos, track camera Author: Hicham Tribak, Youssef Zaz
movements, track moving objects, extract 3D object Description:
models, generate 3D point clouds from stereo cameras, QR (Quick Response) code recognition systems (based
stitch images together to generate an entire scene on computer vision) have always been challenging to
with a high resolution image and many more. be accurately devised due to two main constraints: (1)
Python is a user-friendly language and easy to work QR code recognition system must be able to localize
with but this advantage comes with a cost of speed, as QR codes from an acquired image even in case of
Python is slower to languages such as C or C++.So we unfavorable conditions (illumination variations,
extend Python with C/C++, which allows us to write perspective distortions) and (2) The system must be
computationally intensive code in C/C++ and create adapted to embedded system platforms in terms of
Python wrappers that can be used as Python modules. processing complexity and resources requirement.
Doing this, the code is fast, as it is written in original Most of the earlier proposed QR code recognition
C/C++ code (since it is the actual C++ code working in systems implemented complex feature descriptors
the background) and also, it is easier to code in such as (Harris features, Hough transform which aim
Python than C/C++. OpenCV-Python is a Python at extracting QR code pattern features and
wrapper for the original OpenCV C++ subsequently estimating their positions. This process
implementation. is reinforced by pattern classifiers e.g. (Random
OpenCV is a pre-built, open-source CPU-only library forests, SVM) which are used to remove false detected
(package) that is widely used for computer vision, patterns. Those approaches are very computationally
machine learning, and image processing applications. expensive. Thus, they are not able to be run in real-
It supports a good variety of programming languages time systems. In this paper, a streamlined QR code
including Python. recognition approach is proposed to be efficiently
And that will be a good task for freshers who begin to operable in systems characterized by a limited
contribute to open source projects. Just fork the performance. The evoked approach is conducted as
OpenCV in github, make necessary corrections and follows: the captured image is segmented in order to
send a pull request to OpenCV. OpenCV developers reduce searching space and extract the regions of
will check your pull request, give you important interest. Afterwards a horizontal and vertical scans
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 163
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
are performed to localize preliminarily QR code decoded using an accurate 2-d barcode decoder. Our
patterns, followed by Principal Component Analysis proposed approach is designed for an embedded
(PCA) method which allows removing false positives. systems using a Raspberry Pi equipped with a HD
Thereafter, the remaining patterns are assembled camera and a small robot carrying the equipment.
according to a constraint so as to localize the [3]Title:Recognition of QR Code with mobile phones
corresponding QR codes. Experimental results show Author: Yue Liu, Ju Yang, Mingjun Liu
that the incorporation of PCA decreases notably the Description:QR codes are generally placed in different
processing time and increase QR code recognition environments with complex backgrounds
accuracy (96%). (overlapping text, pictures, etc.), and are often
[2]Title: Remote QR code recognition based on HOG captured under unfavourable conditions such as poor
and SVM classifiers lighting. These factors can significantly affect the
Author: Hicham Tribak, Salah Moughyt, Youssef Zaz, recognition ability and thus may hinder correct QR
Gerald Schaefer code localisation and identification. In order to
Description: appropriately address these issues, in this paper, we
QR codes have become useful and efficient data present a QR code recognition algorithm based on
storage tools which are exploited in many commercial histogram of oriented gradients (HOG) features
applications including product tracking, website combined with support vector machine (SVM)
redirection, etc. A QR code is a 2-dimensional classifiers. Using HOG, we extract gradient features of
barcode localised through three finder patterns (three each extracted pattern. Subsequently, the obtained
squares characterised by a series of alternative black features are passed to two linear SVM classifiers, one
and white modules at ratios 1:1:3:1:1) placed in its trained with finder patterns and one trained with
three corners. QR codes are generally placed in alignment patterns, to remove irrelevant patterns. QR
different environments with complex backgrounds codes are then conveniently localised according to a
(overlapping text, pictures, etc.), and are often pattern closeness constraint. In the last stage, the
captured under unfavourable conditions such as poor captured code is enhanced by applying a perspective
lighting. These factors can significantly affect the correction followed by image binarisation and
recognition ability and thus may hinder correct QR morphological processing. Finally, the patterns are
code localisation and identification. In order to decoded using an accurate 2-d barcode decoder.
appropriately address these issues, in this paper, we [4]Title: Hierarchical Document Clustering Using
present a QR code recognition algorithm based on Frequent Itemsets
histogram of oriented gradients (HOG) features Author: Benjamin C.M. Fung, Ke Wang and Martin
combined with support vector machine (SVM) Ester
classifiers. Using HOG, we extract gradient features of Description:
each extracted pattern. Subsequently, the obtained A major challenge in document clustering is the
features are passed to two linear SVM classifiers, one extremely high dimensionality. For example, the
trained with finder patterns and one trained with vocabulary for a document set can easily be thousands
alignment patterns, to remove irrelevant patterns. QR of words. On the other hand, each document often
codes are then conveniently localised according to a contains a small fraction of words in the vocabulary.
pattern closeness constraint. In the last stage, the These features require special handlings. Another
captured code is enhanced by applying a perspective requirement is hierarchical clustering where clustered
correction followed by image binarisation and documents can be browsed according to the
morphological processing. Finally, the patterns are increasing specificity of topics. In this paper, we
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 164
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
propose to use the notion of frequent itemsets, which so that the user would able to control the brightness
comes from association rule mining, for document of the image which captured by webcam.
clustering. The intuition of our clustering criterion is [6]Title: Secure QR code system
that each cluster is identified by some common words, Author: Raed M. Bani-Hani; Yarub A. Wahsheh;
called frequent itemsets, for the documents in the Mohammad B. Al-Sarhan
cluster. Frequent itemsets are also used to produce a Description: Quick Response (QR) codes are two
hierarchical topic tree for clusters. By focusing on dimensional barcodes that can be used to efficiently
frequent items, the dimensionality of the document store small amount of data. They are increasingly used
set is drastically reduced. We show that this method in all life fields, especially with the wide spread of
outperforms best existing methods in terms of both smart phones which are used as QR code scanners.
clustering accuracy and scalability. While QR codes have many advantages that make
[5]Title: Barcode Recognition System them very popular, there are several security issues
Author: N. M. Z. Hashim, N. A. Ibrahim, N. M. Saad, and risks that are associated with them. Running
F. Sakaguchi, Z. Zakaria malicious code, stealing users' sensitive information
Description: and violating their privacy and identity theft are some
Barcode became essential elements in sales and typical security risks that a user might be subject to in
products services due to importance of keeping the background while he/she is just reading the QR
records of all items in on place. For this purpose, there code in the foreground. In this paper, a security
are many methods implemented to make the barcode system for QR codes that guarantees both users and
reading process became easier to users. This project is generators security concerns is implemented. The
to develop a barcode recognition system by using system is backward compatible with current standard
image processing. The system will be able to read used for encoding QR codes. The system is
barcode through an image and the system capable to implemented and tested using an Android-based
capture the image by using a webcam. This project smartphone application. It was found that the system
will be using MATLAB software program to develop introduces a little overhead in terms of the delay
the system and it will integrate with webcam or required for integrity verification and content
digital camera. System will analyse the image and validation.
then display on the Graphical User Interface (GUI)
the barcode type, data and size of the image. System is III.EXISTING SYSTEM
designed to recognize different types of barcode and
display the data once the barcode image is captured. 1. QR code (Best available Rate Code) is the
System also is to provide convenience way of trademark for a type of barcode.
observing data from the barcode with lower costing 2. In traditional onedimensional bar code we can only
compared by using the electronic barcode scanners. store a maximum of approximately 20 digits, whereas
This system can be used anytime and anywhere by in QR Code we can handle several dozen to several
the user who likes to observe the data represented by hundred times more information.
the barcode numbers without going any places 3. In QR Code we are capable of encoding the same
providing the barcode scanner services. As the result, amount of data in approximately one-tenth of the
the project has been developed smoothly and space as compared to the traditional barcode since in
perfectly. For the future system development, it is QR code we can store data both horizontally and
suggested that the system also should consist a slider vertically. For a smaller printout size, Micro QR Code
is also available.
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 165
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 166
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
of a business process performs accurately to the oriented system integration test. System testing is
documented specifications and contains clearly based on process descriptions and flows, emphasizing
defined inputs and expected results. pre-driven process links and integration points.
5.1.2. INTEGRATION TESTING 5.1.5. WHITE BOX TESTING
Integration tests are designed to test integrated White Box Testing is a testing in which in which the
software components to determine if they actually software tester has knowledge of the inner workings,
run as one program. Testing is event driven and is structure and language of the software, or at least its
more concerned with the basic outcome of screens or purpose. It is purpose. It is used to test areas that
fields. Integration tests demonstrate that although the cannot be reached from a black box level.
components were individually satisfaction, as shown 5.1.6. BLACK BOX TESTING
by successfully unit testing, the combination of Black Box Testing is testing the software without any
components is correct and consistent. Integration knowledge of the inner workings, structure or
testing is specifically aimed at exposing the problems language of the module being tested. Black box tests,
that arise from the combination of components. as most other kinds of tests, must be written from a
5.1.3. FUNCTIONAL TEST definitive source document, such as specification or
Functional tests provide systematic demonstrations requirements document, such as specification or
that functions tested are available as specified by the requirements document. It is a testing in which the
business and technical requirements, system software under test is treated, as a black box .you
documentation, and user manuals. cannot “see” into it. The test provides inputs and
Functional testing is centered on the following items: responds to outputs without considering how the
Valid Input : identified classes of valid input must be software works.
accepted. 5.1.7. UNIT TESTING:
Invalid Input : identified classes of invalid input must Unit testing is usually conducted as part of a
be rejected. combined code and unit test phase of the software
Functions : identified functions must be exercised. lifecycle, although it is not uncommon for coding and
Output : identified classes of application outputs must unit testing to be conducted as two distinct phases.
be exercised Test strategy and approach
Procedures : interfacing systems or procedures must Field testing will be performed manually and
be invoked. functional tests will be written in detail.
Organization and preparation of functional tests is Test objectives
focused on requirements, key functions, or special test • All field entries must work properly.
cases. In addition, systematic coverage pertaining to • Pages must be activated from the identified link.
identify Business process flows; data fields, predefined • The entry screen, messages and responses must not
processes, and successive processes must be be delayed integration test. System testing is based on
considered for testing. Before functional testing is process descriptions and flows, emphasizing pre-
complete, additional tests are identified and the driven process links and integration points.
effective value of current tests is determined.
5.1.4. SYSTEM TEST V. CONCLUSION AND FUTURE WORK
System testing ensures that the entire integrated
software system meets requirements. It tests a In this project, we studied QR code technology, its
configuration to ensure known and predictable results. benefits, application areas, and its impact on
An example of system testing is the configuration marketing and technological world. Initially, QR code
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 167
J Seetha et al Int J Sci Res Sci & Technol. March-April-2024, 11 (2) : 160-168
are developed and use for inventory tracking stuff but, [7]. Zhang, Yunfei, Bo Lu, and Limin Su. "A barcode
now these days, they found applications in many new recognition based on multiform algorithms." In
areas like marketing, advertising, secure payment 2012 4th International Conference on Intelligent
systems, education industries, etc. Adoption of the QR Human-Machine Systems and Cybernetics, vol.
codes grows rapidly during past years and number of 2, pp. 17-20. IEEE, 2012.
users increases exponentially, due to its features like [8]. Narayan, Gayathri Rema, and Mr Vinoth James.
high data storage capacity, fast scanning, error- "Barcode recognition from video by combining
correction, direct marking and ease of use. image processing and xilinx." Procedia
engineering 38 (2012): 2140-2146.
VI. REFERENCES [9]. Joseph, Eugene, and Theodosios Pavlidis. "Bar
code waveform recognition using peak locations."
[1]. Gu, Yunhua, and Weixiang Zhang. "QR code IEEE Transactions on Pattern Analysis and
recognition based on image processing." In Machine Intelligence 16, no. 6 (1994): 630-640.
international conference on information science [10]. GU, Xiao-lin, Ming HUANG, and Hai-yin QI. "2-
and technology, pp. 733-736. IEEE, 2011. Dimensional Bar Code Recognition Based on
[2]. Ohbuchi, Eisaku, Hiroshi Hanaizumi, and Lim Genetic Algorithms [J]." Journal of Dalian
Ah Hock. "Barcode readers using the camera Railway Institute 4 (2005).
device in mobile phones." In 2004 International [11]. LIU, Ning-zhong, and Jing-yu YANG.
conference on cyberworlds, pp. 260-265. IEEE, "Recognition of two-dimensional bar code based
2004. on Fourier Transform." Journal of Image and
[3]. Hashim, N. M. Z., N. A. Ibrahim, N. M. Saad, F. Graphics 8, no. 8 (2003): 877-882.
Sakaguchi, and Z. Zakaria. "Barcode recognition [12]. Falas, Tasos, and Hossein Kashani. "Two-
system." International Journal of Emerging dimensional bar-code decoding with camera-
Trends & Technology in Computer Science equipped mobile phones."
(IJETTCS) 2, no. 4 (2013): 278-283.
[4]. Liu, Yue, Ju Yang, and Mingjun Liu. "Recognition Cite this article as :
of QR Code with mobile phones." In 2008
Chinese control and decision conference, pp. Ms. J Seetha, Dr. G Manikandan, Ms. S. Hemalatha,
203-206. IEEE, 2008. Ms. Vilma Veronica, "QR Code Recognition Based on
[5]. Youssef, Sherin M., and Rana M. Salem. Image Processing", International Journal of Scientific
"Automated barcode recognition for smart Research in Science and Technology (IJSRST), Online
identification and inspection automation." Expert ISSN : 2395-602X, Print ISSN : 2395-6011, Volume 11
Systems with Applications 33, no. 4 (2007): 968- Issue 2, pp. 160-168, March-April 2024. Available at
977. doi : https://doi.org/10.32628/IJSRST52411227
[6]. Kuroki, Mikio, Takayuki Yoneoka, Tetsua Satou, Journal URL : https://ijsrst.com/IJSRST52411227
Yoichi Takagi, Tadaaki Kitamura, and Noriaki
Kayamori. "Bar-code recognition system using
image processing." In 1997 IEEE 6th
International Conference on Emerging
Technologies and Factory Automation
Proceedings, EFTA'97, pp. 568-572. IEEE, 1997.
International Journal of Scientific Research in Science and Technology (www.ijsrst.com) | Volume 11 | Issue 2 168