SlideShare a Scribd company logo
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 311
Implementation of Computer Vision Applications usingOpenCV in C++
Adwait Bhave, Vaishnavi Jadhav, Punit Bhandari, Vaishnavi Patil
Department of Electronics and Telecommunication Engineering, Pune Vidyarthi Griha’s College of
Engineering Technology Project Guide: Prof. Anand Najan
Sponsored by NSM Solutions Pvt. Ltd.Industry guide: Mr. Nishad Mande
-----------------------------------------------------------------------***----------------------------------------------------------------------
Abstract — Computer Vision (CV) has emerged as a
critical field in various domains, ranging from
autonomous vehicles to medical imaging. OpenCV, an
open-source computer vision library, provides a rich
set of functions and algorithms for image processing,
feature detection, object recognition, and more. This
paper presents a comprehensive study of integrating
OpenCV with C++, aiming to explore its potential for
developing robust and efficient CV applications. We
present practical examples that demonstrate the
seamless integration ofOpenCV with C++. We showcase
real-world applications such as facial recognition,
motion detection, and augmented reality, highlighting
the versatility and extensibility of the OpenCV library
when utilized alongside the C++ programming language
Keywords – Computer Vision, OpenCV, C++, Text
Recognition, colour detection, barcode decoding, Text
on
OpenCV (Open-Source Computer Vision Library) is a
widely-used open-source computer vision and machine
learning software library. It provides developers with a rich
set of tools and algorithms for image and video processing,
object detection and recognition, and other computer vision
tasks. OpenCV is written in C++, which makes it a powerful
and efficient library for real-time computer vision
applications.
C++ provides a powerful and flexible environment for
implementing CV algorithms, leveraging features like
operator overloading, templates, and memory management.
We explore how C++ enhances the performance of OpenCV-
based applications through its low-level control and
efficient resource utilization.
We will be using various OpenCV and image processing
functions and algorithms like Grey-scaling, edge-detection,
morphology, contours, thresholding etc.
Computer vision tasks such as object detection and
recognition benefit from image processing techniques.
Computer vision systems can recognise and categorise
objects in pictures or video streams by extracting features,
matching patterns, and using machine learning methods.
Image processing enables applications like object tracking,
surveillance, and autonomous navigation by helping to
distinguish things based on colour, shape, texture, or other
visual properties. Tools for picture analysis and
interpretation are provided by image processing in order
to get useful data from images. This involves activities
like measuring, motion analysis, scene comprehension,
andObject and Text Recognition, for the following given
usecases
1. Colour Detection
2. Barcode Decoding
3. Text Recognition
4. Text on Image
The field of computer vision in C++ is active and quickly
developing, with many new scientific discoveries and useful
applications. In our Project we used four different use cases
of computer-vision which we implemented using the
programming language C++.
There are large number of studies and research in the field
of computer-vision but it is all done in the programming
language of python. Implementing it in C++ was a challenge
in itself as not many researches were there regarding our
use cases. Here is a summary of the important studies.
1. "Learning OpenCV 3: Computer Vision in C++ with
the OpenCV Library" by Adrian Kaehler and Gary
Bradski - This book is a comprehensive guideto the
OpenCV library and is ideal for beginners who
want to learn computer vision using C++ and
OpenCV.
Image
I. INTRODUCTION
II. LITERATURE REVIEW
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 312
2. “Recognizing one-dimensional barcode using
OpenCV” by Junhao Liang and Tianqi Wang give a
depth view in how barcode decoding works.
3. “Process of Detecting Barcodes Using Image
Processing” by Kopila Pariyar explained the
process of barcode detection
4. “OCR Service Platform Based on OpenCV” by
Jianjun Cai, Erxin Sun, Zongjuan Chen. The study
found that the OCR technique achieved high
accuracy in text recognition and detection.
5. "Mastering OpenCV 4 with Python: A Practical
Guide Covering Topics from Image Processing,
Augmented Reality to Deep Learning with OpenCV
4 and Python 3.7" by Alberto Fernandez and
Prateek Joshi - This book covers the latest version
of OpenCV and provides hands-on examples of
how to use OpenCV with Python to solve real-
world problems.
While working on this project we had to take a different
approach while coming up with the code for each use case
as there was not enough study materials related to the
topic.
This led us to build the code and decide the method from
scratch. With different permutation and combinations
used as well as taking useful functions from programing
language python and converting and tweaking the
function/algorithm as per our need helped us to gain more
insight about the expected outcome.
A. Block Diagram
a) Colour Detection
b) Text Recognition
c) Barcode Decoding
d) Text on Image
B. Synthesis/Algorithm/Design/Method
1) Colour Detection RGB Colour Model -
Red, green, and blue colours are combined in varying
ratios to create a variety of colours in the RGB colour
model, which is an additive colour scheme. A colour
model is a method for multiplying a few core colours to
produce many hues. Model light is used to display
colour in additive colour. Colour mixing is additive in
the RGB colour model [7]. It is the technique of
combining the red, green, and blue primary colours in
various ratios to create other colours. HSV colour
gamut The Hue (H), the colour type (such as red,
green), and the saturation (S) of the colour are the
threeelements that make up the HSV (Hue, Saturation,
Value) model, sometimes known as HSB (Hue,
Saturation, Brightness). It has a red angle of 0 to 360
degrees.
III. METHODOLOGY/EXPERIMENTAL
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 313
2) Text Recognition –Tesseract Library:
Text extraction from photographs or scanned
documents is made possible via text recognition in
OpenCV using the Tesseract package, which is a
reliable and popular method. Tesseract, a Google-
developed open-source OCR engine, for precise and
effective text recognition.
Tesseract analyses and recognises the text within the
specified regions using cutting-edge OCR algorithms.
Text recognition in OpenCV utilising the Tesseract
library enables the extraction of textual information
from photos or scanned documents with high
accuracyand efficiency by combining OpenCV's image
processing skills with Tesseract's potent OCR
techniques.
3) Barcode Decoding –
In order to extract information from digital images,
computer vision must first modify and analyse the
images. This process is known as image processing
and detection. Several important methods and
processes thatare frequently used in image processing
and detection.
● Grey scaling and the Sobel Function: Greyscale
photos can be used with the Sobel function [3], a
well-known edge detection technique, to locate
andhighlight edges based on the gradient of pixel
intensity.
● Blurring and Thresholding: Blurring, commonly
referred to as smoothing, is a technique for
removing small features from an image and
reducing noise and thresholding entails separating
a picture into binary sections according to a
predetermined threshold value.
● Morphology Operations: A set of operations used
toexamine and modify the shapes and structures
found in an image are referred to as morphology
operations.
● Contours: The borders or outlines of items in a
picture are known as contours. They are essential
in the detection, identification, and study of
objects' shapes.
● ZBar Library: Zbar is an open-source software
library that offers the ability to scan barcodes and
QR codes.
● Region of Interest: In image processing, ROI stands
for region of interest. It describes a particular area
or region inside an image that is picked out for
additional examination, processing, or information
extraction.
● Decoding Algorithm: it is the algorithm based on
Otsu Model.
4) Text on Image –
• Put Text: This function is used to write text on an
image. It takes the following parameters:
• Image: The input image on which the text will be
written.
• Text: The actual text string to be written.
• Position: The coordinates (x, y) of the starting point
of the text.
• Font type and size: The font type and size of the
text.
• Color: The color of the text.
• Thickness: The thickness of the text.
• Line type: The type of line used for drawing the
text.
• Text Size: This function calculates the size of the
text string.
• Scalar: This class represents a color in OpenCV.You
can specify the color using the BGR (Blue, Green,
Red) format.
• These are pre-defined font types available in
OpenCV for writing text.
FONT_HERSHEY_SIMPLEX,
FONT_HERSHEY_PLAIN, FONT_HERSHEY_DUPLEX,
etc.
C. Expected Outcome
1) Colour Detection:
We were able to successfully isolate the objects of which
colour code we had given in the HSV tracker. Thus Object
detection was successful.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 314
2) Text Recognition:
We were able to successfully Detect the text using
OpenCV functions in C++
But the tesseract library which was initially a part of
OpenCV module for C++ was mot working giving errors.
Hence to prove our methodology and algorithm is precise
and correct we tried the same algorithm in programming
language Python.
3) Barcode Decoding:
We faced the same problem like in [2] above, where the
original Zbar (barcode decoding library) was in the
OpenCV package, but it was discontinued for C++
programming language. So after many Permutations and
Combinations we were able to achieve a Near Perfection
barcode Detection
We were able to successfully Decode UPC-A barcodes using
basic OpenCV Functions and algorithms in C++ without the
Pre-trained library Zbar.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 315
4) Text on Image:
We got the desired outcome for our text on image use case
IV. CONCLUSION AND FUTURESCOPE
The project “Implementation of Computer Visionapplications
using OpenCV in C++"is an innovative project that can be
seen as a demonstration project for understanding the basic
concepts of computer vision, machine learning, and image
processing by using different algorithms.
It also provides information on Object Detection models,
Artificial Intelligence, and Computer Vision Algorithms for
researchers who are really interested in the topic. This
project can be used by researchers as an overview or an
example project to understand how image processing
functions, its significance in the field of computer vision, and
the fundamental steps that must be taken into consideration.
It acts as a significant demo project. Except for the phases
where the Pre-trained libraries such as Tesseract and ZBar []
were withdrawn, the fundamentals of image processing and
computer vision are easy to understand. This led us to
employing different method for those use-cases.
1) Industrial Automation: Computer vision is
increasingly being used in industrial
automation to increase quality control,
inspection, and process optimization
2) Security and Surveillance: Computer vision
is extremely important in security and
surveillance systems. The object detection,
tracking, and behavior analysis capabilities
ofOpenCV help to construct intelligent video
surveillance systems.
We were able to complete our project's primary
objective—the implementation of all computer vision apps
in C++, despite a few small difficulties. Testing a variety
of other C++ and Python programming language may help
this project advance. Applications for computer vision in
C++ may be used to set up automation plants or
automate conveyer belt system operations for a particular
project or product line.
More OpenCV advancements and applications are
expected in the following areas:
3) Real-time and Embedded Systems: As smart
devices and the Internet of Things (IoT)
proliferate, there is an increasing demand
for real-time computer vision applications
that can run efficiently on resource-
constrained devices.
4) Integration with other Technologies: Deep
learning techniques, specifically
convolutional neural networks (CNNs), have
transformed computer vision. TensorFlow
and PyTorch are two popular libraries that
have been integrated. In augmented reality
(AR) and virtual reality (VR) applications,
computer vision is critical.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072
[1] https://pyimagesearch.com/2014/12/15/real-time-
barcode-detection-video-python-opencv/
[2] https://www.ijser.org/researchpaper/Naive-Bayes-
Approached-in-Color-Detection-using-Pandas-
OpenCV.pdf
[3] https://laconicml.com/barcode-detection-opencv/
[4] https://pyimagesearch.com/2018/05/21/an-opencv-
barcode-and-qr-code-scanner-with-zbar/
[5] https://link.springer.com/chapter/10.1007/978-3-
030-20904-9_9
[6] papers.ssrn.com/sol3/Delivery.cfm/SSRN_ID38799
81_code3665699.pdf?abstractid=3879981
Finally, with its broad features, cross-platform
compatibility, active community support, and integration
capabilities, the future of OpenCV implemented in C++
appears excellent. While it has a steep learning curve and
only limited supportfor advanced approaches, its excellent
performance and versatility make it a powerful tool for a
wide range of computer vision applications.
V. REFERENCES
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 316

More Related Content

Similar to Implementation of Computer Vision Applications using OpenCV in C++ (20)

PDF
Color Based Object Tracking with OpenCV A Survey
YogeshIJTSRD
 
DOCX
newcgreppainnewcgreppainnewcgreppainnewcgreppainnewcgreppain
LekhakXerox
 
PDF
Design and Description of Feature Extraction Algorithm for Old English Font
IRJET Journal
 
PDF
Complete End-to-End Low Cost Solution to a 3D Scanning System with Integrate...
AIRCC Publishing Corporation
 
PDF
A Wireless Network Infrastructure Architecture for Rural Communities
AIRCC Publishing Corporation
 
PDF
Complete End-to-End Low Cost Solution to a 3D Scanning System with Integrated...
AIRCC Publishing Corporation
 
PDF
COMPLETE END-TO-END LOW COST SOLUTION TO A 3D SCANNING SYSTEM WITH INTEGRATED...
ijcsit
 
PPTX
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
Anish Patel
 
PDF
IRJET- Intelligent Character Recognition of Handwritten Characters
IRJET Journal
 
PDF
Devanagari Character Recognition using Image Processing & Machine Learning
IRJET Journal
 
PDF
Optical Character Recognition from Text Image
Editor IJCATR
 
PDF
IRJET - Object Detection using Hausdorff Distance
IRJET Journal
 
PDF
IRJET- Designing of OCR Tool Box for Decoding Vehicle Number Plate using MATLAB
IRJET Journal
 
PDF
Detection of a user-defined object in an image using feature extraction- Trai...
IRJET Journal
 
PDF
IRJET- Object Detection using Hausdorff Distance
IRJET Journal
 
PDF
40120140501009
IAEME Publication
 
PDF
IRJET-MText Extraction from Images using Convolutional Neural Network
IRJET Journal
 
PDF
Handwritten Digit Recognition Using CNN
IRJET Journal
 
PDF
Real-Time Color Detection Using Python and OpenCV
IRJET Journal
 
PDF
IRJET- Finding Dominant Color in the Artistic Painting using Data Mining ...
IRJET Journal
 
Color Based Object Tracking with OpenCV A Survey
YogeshIJTSRD
 
newcgreppainnewcgreppainnewcgreppainnewcgreppainnewcgreppain
LekhakXerox
 
Design and Description of Feature Extraction Algorithm for Old English Font
IRJET Journal
 
Complete End-to-End Low Cost Solution to a 3D Scanning System with Integrate...
AIRCC Publishing Corporation
 
A Wireless Network Infrastructure Architecture for Rural Communities
AIRCC Publishing Corporation
 
Complete End-to-End Low Cost Solution to a 3D Scanning System with Integrated...
AIRCC Publishing Corporation
 
COMPLETE END-TO-END LOW COST SOLUTION TO A 3D SCANNING SYSTEM WITH INTEGRATED...
ijcsit
 
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
Anish Patel
 
IRJET- Intelligent Character Recognition of Handwritten Characters
IRJET Journal
 
Devanagari Character Recognition using Image Processing & Machine Learning
IRJET Journal
 
Optical Character Recognition from Text Image
Editor IJCATR
 
IRJET - Object Detection using Hausdorff Distance
IRJET Journal
 
IRJET- Designing of OCR Tool Box for Decoding Vehicle Number Plate using MATLAB
IRJET Journal
 
Detection of a user-defined object in an image using feature extraction- Trai...
IRJET Journal
 
IRJET- Object Detection using Hausdorff Distance
IRJET Journal
 
40120140501009
IAEME Publication
 
IRJET-MText Extraction from Images using Convolutional Neural Network
IRJET Journal
 
Handwritten Digit Recognition Using CNN
IRJET Journal
 
Real-Time Color Detection Using Python and OpenCV
IRJET Journal
 
IRJET- Finding Dominant Color in the Artistic Painting using Data Mining ...
IRJET Journal
 

More from IRJET Journal (20)

PDF
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
PDF
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
PDF
Kiona – A Smart Society Automation Project
IRJET Journal
 
PDF
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
PDF
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
PDF
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
PDF
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
PDF
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
PDF
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
PDF
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
PDF
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
PDF
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
PDF
Breast Cancer Detection using Computer Vision
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
Kiona – A Smart Society Automation Project
IRJET Journal
 
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
Breast Cancer Detection using Computer Vision
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Ad

Recently uploaded (20)

PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPTX
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
PPTX
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PDF
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Day2 B2 Best.pptx
helenjenefa1
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
MRRS Strength and Durability of Concrete
CivilMythili
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
Ad

Implementation of Computer Vision Applications using OpenCV in C++

  • 1. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 311 Implementation of Computer Vision Applications usingOpenCV in C++ Adwait Bhave, Vaishnavi Jadhav, Punit Bhandari, Vaishnavi Patil Department of Electronics and Telecommunication Engineering, Pune Vidyarthi Griha’s College of Engineering Technology Project Guide: Prof. Anand Najan Sponsored by NSM Solutions Pvt. Ltd.Industry guide: Mr. Nishad Mande -----------------------------------------------------------------------***---------------------------------------------------------------------- Abstract — Computer Vision (CV) has emerged as a critical field in various domains, ranging from autonomous vehicles to medical imaging. OpenCV, an open-source computer vision library, provides a rich set of functions and algorithms for image processing, feature detection, object recognition, and more. This paper presents a comprehensive study of integrating OpenCV with C++, aiming to explore its potential for developing robust and efficient CV applications. We present practical examples that demonstrate the seamless integration ofOpenCV with C++. We showcase real-world applications such as facial recognition, motion detection, and augmented reality, highlighting the versatility and extensibility of the OpenCV library when utilized alongside the C++ programming language Keywords – Computer Vision, OpenCV, C++, Text Recognition, colour detection, barcode decoding, Text on OpenCV (Open-Source Computer Vision Library) is a widely-used open-source computer vision and machine learning software library. It provides developers with a rich set of tools and algorithms for image and video processing, object detection and recognition, and other computer vision tasks. OpenCV is written in C++, which makes it a powerful and efficient library for real-time computer vision applications. C++ provides a powerful and flexible environment for implementing CV algorithms, leveraging features like operator overloading, templates, and memory management. We explore how C++ enhances the performance of OpenCV- based applications through its low-level control and efficient resource utilization. We will be using various OpenCV and image processing functions and algorithms like Grey-scaling, edge-detection, morphology, contours, thresholding etc. Computer vision tasks such as object detection and recognition benefit from image processing techniques. Computer vision systems can recognise and categorise objects in pictures or video streams by extracting features, matching patterns, and using machine learning methods. Image processing enables applications like object tracking, surveillance, and autonomous navigation by helping to distinguish things based on colour, shape, texture, or other visual properties. Tools for picture analysis and interpretation are provided by image processing in order to get useful data from images. This involves activities like measuring, motion analysis, scene comprehension, andObject and Text Recognition, for the following given usecases 1. Colour Detection 2. Barcode Decoding 3. Text Recognition 4. Text on Image The field of computer vision in C++ is active and quickly developing, with many new scientific discoveries and useful applications. In our Project we used four different use cases of computer-vision which we implemented using the programming language C++. There are large number of studies and research in the field of computer-vision but it is all done in the programming language of python. Implementing it in C++ was a challenge in itself as not many researches were there regarding our use cases. Here is a summary of the important studies. 1. "Learning OpenCV 3: Computer Vision in C++ with the OpenCV Library" by Adrian Kaehler and Gary Bradski - This book is a comprehensive guideto the OpenCV library and is ideal for beginners who want to learn computer vision using C++ and OpenCV. Image I. INTRODUCTION II. LITERATURE REVIEW
  • 2. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 312 2. “Recognizing one-dimensional barcode using OpenCV” by Junhao Liang and Tianqi Wang give a depth view in how barcode decoding works. 3. “Process of Detecting Barcodes Using Image Processing” by Kopila Pariyar explained the process of barcode detection 4. “OCR Service Platform Based on OpenCV” by Jianjun Cai, Erxin Sun, Zongjuan Chen. The study found that the OCR technique achieved high accuracy in text recognition and detection. 5. "Mastering OpenCV 4 with Python: A Practical Guide Covering Topics from Image Processing, Augmented Reality to Deep Learning with OpenCV 4 and Python 3.7" by Alberto Fernandez and Prateek Joshi - This book covers the latest version of OpenCV and provides hands-on examples of how to use OpenCV with Python to solve real- world problems. While working on this project we had to take a different approach while coming up with the code for each use case as there was not enough study materials related to the topic. This led us to build the code and decide the method from scratch. With different permutation and combinations used as well as taking useful functions from programing language python and converting and tweaking the function/algorithm as per our need helped us to gain more insight about the expected outcome. A. Block Diagram a) Colour Detection b) Text Recognition c) Barcode Decoding d) Text on Image B. Synthesis/Algorithm/Design/Method 1) Colour Detection RGB Colour Model - Red, green, and blue colours are combined in varying ratios to create a variety of colours in the RGB colour model, which is an additive colour scheme. A colour model is a method for multiplying a few core colours to produce many hues. Model light is used to display colour in additive colour. Colour mixing is additive in the RGB colour model [7]. It is the technique of combining the red, green, and blue primary colours in various ratios to create other colours. HSV colour gamut The Hue (H), the colour type (such as red, green), and the saturation (S) of the colour are the threeelements that make up the HSV (Hue, Saturation, Value) model, sometimes known as HSB (Hue, Saturation, Brightness). It has a red angle of 0 to 360 degrees. III. METHODOLOGY/EXPERIMENTAL
  • 3. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 313 2) Text Recognition –Tesseract Library: Text extraction from photographs or scanned documents is made possible via text recognition in OpenCV using the Tesseract package, which is a reliable and popular method. Tesseract, a Google- developed open-source OCR engine, for precise and effective text recognition. Tesseract analyses and recognises the text within the specified regions using cutting-edge OCR algorithms. Text recognition in OpenCV utilising the Tesseract library enables the extraction of textual information from photos or scanned documents with high accuracyand efficiency by combining OpenCV's image processing skills with Tesseract's potent OCR techniques. 3) Barcode Decoding – In order to extract information from digital images, computer vision must first modify and analyse the images. This process is known as image processing and detection. Several important methods and processes thatare frequently used in image processing and detection. ● Grey scaling and the Sobel Function: Greyscale photos can be used with the Sobel function [3], a well-known edge detection technique, to locate andhighlight edges based on the gradient of pixel intensity. ● Blurring and Thresholding: Blurring, commonly referred to as smoothing, is a technique for removing small features from an image and reducing noise and thresholding entails separating a picture into binary sections according to a predetermined threshold value. ● Morphology Operations: A set of operations used toexamine and modify the shapes and structures found in an image are referred to as morphology operations. ● Contours: The borders or outlines of items in a picture are known as contours. They are essential in the detection, identification, and study of objects' shapes. ● ZBar Library: Zbar is an open-source software library that offers the ability to scan barcodes and QR codes. ● Region of Interest: In image processing, ROI stands for region of interest. It describes a particular area or region inside an image that is picked out for additional examination, processing, or information extraction. ● Decoding Algorithm: it is the algorithm based on Otsu Model. 4) Text on Image – • Put Text: This function is used to write text on an image. It takes the following parameters: • Image: The input image on which the text will be written. • Text: The actual text string to be written. • Position: The coordinates (x, y) of the starting point of the text. • Font type and size: The font type and size of the text. • Color: The color of the text. • Thickness: The thickness of the text. • Line type: The type of line used for drawing the text. • Text Size: This function calculates the size of the text string. • Scalar: This class represents a color in OpenCV.You can specify the color using the BGR (Blue, Green, Red) format. • These are pre-defined font types available in OpenCV for writing text. FONT_HERSHEY_SIMPLEX, FONT_HERSHEY_PLAIN, FONT_HERSHEY_DUPLEX, etc. C. Expected Outcome 1) Colour Detection: We were able to successfully isolate the objects of which colour code we had given in the HSV tracker. Thus Object detection was successful.
  • 4. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 314 2) Text Recognition: We were able to successfully Detect the text using OpenCV functions in C++ But the tesseract library which was initially a part of OpenCV module for C++ was mot working giving errors. Hence to prove our methodology and algorithm is precise and correct we tried the same algorithm in programming language Python. 3) Barcode Decoding: We faced the same problem like in [2] above, where the original Zbar (barcode decoding library) was in the OpenCV package, but it was discontinued for C++ programming language. So after many Permutations and Combinations we were able to achieve a Near Perfection barcode Detection We were able to successfully Decode UPC-A barcodes using basic OpenCV Functions and algorithms in C++ without the Pre-trained library Zbar.
  • 5. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 315 4) Text on Image: We got the desired outcome for our text on image use case IV. CONCLUSION AND FUTURESCOPE The project “Implementation of Computer Visionapplications using OpenCV in C++"is an innovative project that can be seen as a demonstration project for understanding the basic concepts of computer vision, machine learning, and image processing by using different algorithms. It also provides information on Object Detection models, Artificial Intelligence, and Computer Vision Algorithms for researchers who are really interested in the topic. This project can be used by researchers as an overview or an example project to understand how image processing functions, its significance in the field of computer vision, and the fundamental steps that must be taken into consideration. It acts as a significant demo project. Except for the phases where the Pre-trained libraries such as Tesseract and ZBar [] were withdrawn, the fundamentals of image processing and computer vision are easy to understand. This led us to employing different method for those use-cases. 1) Industrial Automation: Computer vision is increasingly being used in industrial automation to increase quality control, inspection, and process optimization 2) Security and Surveillance: Computer vision is extremely important in security and surveillance systems. The object detection, tracking, and behavior analysis capabilities ofOpenCV help to construct intelligent video surveillance systems. We were able to complete our project's primary objective—the implementation of all computer vision apps in C++, despite a few small difficulties. Testing a variety of other C++ and Python programming language may help this project advance. Applications for computer vision in C++ may be used to set up automation plants or automate conveyer belt system operations for a particular project or product line. More OpenCV advancements and applications are expected in the following areas: 3) Real-time and Embedded Systems: As smart devices and the Internet of Things (IoT) proliferate, there is an increasing demand for real-time computer vision applications that can run efficiently on resource- constrained devices. 4) Integration with other Technologies: Deep learning techniques, specifically convolutional neural networks (CNNs), have transformed computer vision. TensorFlow and PyTorch are two popular libraries that have been integrated. In augmented reality (AR) and virtual reality (VR) applications, computer vision is critical.
  • 6. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 [1] https://pyimagesearch.com/2014/12/15/real-time- barcode-detection-video-python-opencv/ [2] https://www.ijser.org/researchpaper/Naive-Bayes- Approached-in-Color-Detection-using-Pandas- OpenCV.pdf [3] https://laconicml.com/barcode-detection-opencv/ [4] https://pyimagesearch.com/2018/05/21/an-opencv- barcode-and-qr-code-scanner-with-zbar/ [5] https://link.springer.com/chapter/10.1007/978-3- 030-20904-9_9 [6] papers.ssrn.com/sol3/Delivery.cfm/SSRN_ID38799 81_code3665699.pdf?abstractid=3879981 Finally, with its broad features, cross-platform compatibility, active community support, and integration capabilities, the future of OpenCV implemented in C++ appears excellent. While it has a steep learning curve and only limited supportfor advanced approaches, its excellent performance and versatility make it a powerful tool for a wide range of computer vision applications. V. REFERENCES © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 316