You are on page 1of 8

Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

AN OVERVIEW ON OBJECT DETECTION


USING OPEN CV - PYTHON
Vinod Tiwari1, Ashish Rawat2, Dharmendra Kumar3
1.2
Master of Computer Application Student, Uttaranchal University, Dehradun, India
3
Assistant Professor, Computer Science, Uttaranchal University, Dehradun, India

ABSTRACT-. Today, Machine Learning using popular language Python. This language to perform for
multiple tasks.
Image Processing (Object Detection) is a well-Know computer technology connected with computer and
image processing that focuses on detecting objects or show detecting images via information and detail of
a showing image. In this study to check the process of image and fetching of data particular selected images.
In this Object to performing to different types of tasks like we check the flow of image and calculated to
data via open cv.
In this study, basic concepts used on Image Processing while making use of open cv library and analysis
data jupyter notebook library of python 3.8, improving the efficiency of image processing.
Keywords: Image processing, open cv, Jupyter Notebook, python.

1. INTRODUCTION

Image Processing [1] is a process of the image. It is little about processing, as one object to divided into
different types of processing. In this study discuss a “How to Process Image!” and object detection[2]. This
is not a brand new technique however improvement in object detection remains needed to attain the targeted
objective a lot of expeditiously and accurately.

The main aim of studying and researching computer vision is to simulate the behavior and manner of human
eyes directly by employing a computer and afterward develop a system that reduces human efforts.
Computer vision is such a quite research field that tries to perceive and represent the 3D information for
world objects. Its main purpose is to reconstruct the visual aspects of 3D objects after analyzing the 2D
information extracted. real-world 3D objects are represented by 2D images.

Object detection from a posh background may be a challenging application in image processing. The goal
of this project is to spot objects placed over a surface from a posh background image using various
techniques. The detection of the objects is often extended using automation and robotics for plucking of the
objects like apples, bananas from the corresponding tree using the image processing techniques and it'll be
easier, faster, and convenient to pluck the apples and bananas instead of the manual plucking.

Inside this paper, we will discuss that? Capturing objects and getting information from them. Our next step
to apply an algorithm that uses the machine learning concept.

OpenCV library implemented in python3.8 along with the help of NumPy is used and the world of object
detection is explored, a virtual Artificial Neural Network is created using Sci-kit too.

Volume XII, Issue VI, June/2020 Page No:1234


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

2. CONCEPT

2.1 Theory

All Object! The class has its special features. Who helps in classify the object. Object recognition is that
image or video sequence of computer vision that are effective in helping to identify objects. With the help
of more efficient algorithms, objects can be identified when they are partially interrupted by direct
visualization. Various approaches to this work have been applied in previous years.

Types of terms are used in object detection:

 Edge matching
 Conquer search
 Grayscale matching
 Gradient matching
The ease of dealing with the image is that it is creating up of pixels, so in most cases, the location of the
next point is easily found and can be connected with our current pixel anytime. Take an image of a circle,
convert into a grayscale image, detect edges, move along edges, and draw normal. Now repeat this process
for the entire circle or find connected edges and then calculate the distance between the center circle and
the connected points.

2.2 Open CV
Open CV is called Open Source Computer Vision. In this software library, we used different types of
machine learning programming and another way. This provides an infrastructure for computer application.
It makes it easy to modify code.[3]

OpenCV library inside 2000 plus algorithms, all algorithms are freely optimized. It helps real-time vision
applications. These algorithms can be used to detect and recognize objects. This algorithm withs all help
different types of image reading.

For work on an OpenCV, install the NumPy package and python 3.8 first.

2.3 NumPy
NumPy is called Numerical Python. NumPy is a python library used for working with arrays. Python
NumPy is cross-platform. Along with that, it provides a gamut of high-level functions to perform
mathematical operations on these structures. This can be seen as an alternative to MATLAB.[4]
Feature of NumPy:
 Multidimensional arrays.
 Functions and operators for these arrays.
 Python Alternative to MATLAB.
 Shapes manipulation.
 Linear algebra
NumPy is developed in the open on GitHub, through the consensus of the NumPy and wider scientific
Python community.
We will use this library to detect objects and perform some operations.

Volume XII, Issue VI, June/2020 Page No:1235


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

2.4 Jupyter Notebook


We install this software with the help of Python. By using this library, we can act as a text editor. It is
divided into two parts, the first part is online and the second part is offline which runs on our local server.
This is Python's library and we use it in data science and machine learning. We will use it to write and run
the object detection program in this project.

2.5 Process of moving object Detection-


The object classification approach is based on shape, motion, color, and texture. The classification can be
done under various classes such as trees, animals, humans, objects, etc.

2.5.1 Shape-Based

In this detection system, the inputs are the combination of scene and object-based frameworks which are
image binary large objects area, blob bounding box‘s aspect ratio, and zoom in camera. Every frame in blob
performs a different classification. The histogram reserve all the results.

2.4.2 Motion Based

The moving object detection method is used texture-based features to identify the object’s movement. In
the proposed method of motion-based object detection, here we only consider the clusters which follow
important aspects such as objects minimum height and width and trajectory’s minimum reliability in this
first method it reduce all the clusters that are far from the camera and are not showing any movement that
can be observed the second condition proposed all the well-known problems that can be solved quickly.
Image areas are colored, large which are divided into a similar cluster.

2.4.3 Color Based

To tracking the videos and object detection, colors play an important role. It’s an extensively used feature
in image detection. For object detection, color histograms are used to model objects. it is cheaper in
computational cost, scale, and rotation. Color-based techniques are used to detect real-time running
movement.
2.4.4 Texture-Based

The physical patter of the object helps to recognize the object. It is similar to a motion-based approach. it
gives better calculations and accuracy to detect the object. But it consumes much time which can be
improved by using some fast techniques.

3. STEPS OF USE IN OBJECT DETECTION IN PYTHON 3.8

3.1 Install OpenCV-Python

First, we have to download Python's latest software, after that, we have to install the library of object detection, then from the
help of those libraries, we will start the process of object detection which will read an object apple with a different method.
There is an extra library we have to install like NumPy, Matplotlib, OpenCV, Jupyter Notebook, cv2.pdy, Scikit, and Keras.[5]

Note: Python 3.8v must be install.

Volume XII, Issue VI, June/2020 Page No:1236


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

3.2 Read an Image

First, we have to install the lab of object detection. Read an image using this function CV2.imread() and in
this function to pass the first argument in your image path. The second argument pass to another way of
reading images.
1. CV2.IMREAD_COLOR: It is a function used to import a color image.
2. CV2.IMREAD_GRAYSCALE: It is a function used to load a grayscale mode.
3. CV2.IMREAD_UNCHANGED: It is a function used to load an alpha channel.
4. CV2.VIDEOCAPTURE: It is a function used to load a camera.

4 APPLY OBJECT DETECTION ALGORITHMS IN PYTHON

4.1 Circular Hough Transformation


Richard Duda and peter hart proposed a transformation technique named Hough transformation. It was
meant to detect the initially arbitrary shapes from an object. Further, it was converted to detect the circular
objects which are low noisy contrast images. The equation for Circular Hough Transformation
r2 = (x-a)2 +(x-b)2
here ‘a’ and ‘b’ are center coordinate and r is the radius of a circle.
CHT has three important factors that needed high memory, larger computing time and it increases the
complexity when it extracts the information from the image.

Fig 4.1: Circular Hough Transformation

Volume XII, Issue VI, June/2020 Page No:1237


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

4.2 Template matching


It is a high-level machine vision technology that helps to detect an object from an image that completely
matches the image pattern. It is used to get a small piece of image from a large image. To do so there is
predefined function cv2.matchTemplate() . the template image slides the input image.
Here feature-based approaches are used if the template image has strong features otherwise there will be
using a template-based approach.

Fig 4.2: Template matching

4.3 Blob detection


The blob detection method was proposed to detect the different regions in an image. Blob separate objects
in an image binary manner. It has a collection of connected pixels. We can determine that the two pixels in
the image are connected with each other or not.

Fig 4.3: Blob detection

Volume XII, Issue VI, June/2020 Page No:1238


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

4.4 The Gradient-based method


The gradient-based method is used to approximate image flow in the image at every position. If the object
is not in motion in advance it will restrict all the small range of possible values after that it will analyze
multi-scale that would be applied on the different derivatives that appropriate the scale of the motion. this
method makes it very expensive in computation.

Fig 4.4 The Gradient-based method

4.5 Local Binary Pattern


LBP is a form of the visual descriptor. Which is used or computer vision classification? It is a texture-
based model and was proposed in 1990. It was used for texture-based feature classification.
LBP feature vector is developed in the following manner :
• It divides the window into cells
• It has 8 neighbors of each pixel in every pixel cell and its pixels follow the circular motion like
clockwise or anticlockwise.
• If the center pixel has greater value than its neighbor pixel’s pixel, the value would be 0 otherwise
value would be 1.
• Calculate the histogram of each cell over the rate of occurring on every number occurring.

Fig 4.5: Local Binary Pattern

Volume XII, Issue VI, June/2020 Page No:1239


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

6. APPLICATION OF OBJECT/FACE DETECTION


The object/face recognition technology is an emerging technology. It provides security as well as the
expected result. It is a computer-based technology that determined the location and size of objects in digital
form. It has following application:-
6.1 In Security companies:- Object recognition is using in the security sector. It can recognize individuals
accurately. Security agencies use IP cameras that have face recognition application that can easily detect
the authorized employee of the organization.
6.2 In fleet management:- Object recognition is used in fleet management of vehicles. if any unauthorized
individual wants to gain access to the vehicle for preventing theft, the software will send him to alert so
that he can’t theft that vehicle. this technology is helpful when the vehicle driver is drunk, over speeding.
The software will send an alert message to the driver that helps to reduce the accidents.
6.3 Counting objects and people:- It is used for counting purposes. It counts the people or objects from a
large amount of crowd. It is also used to count pixels of image search from a large image.
6.4 Surveillance:- It used to identify and detect suspicious or harmful items for security purposes.
6.5 Biometric recognition:- it is used to record or analyze the individual’s behavioral and physical traits.
6.6 Medical analysis:- It is used in the medical field to know the disease of the person. It can identify the
disease by analyzing the individual’s face.
7. CHALLENGES
The major object of object detection technology is to divide the localization of the object known as object
positioning. To direct this problem many researchers used multi-task loss function to penalize localization
and misclassification. It consumes much time and doesn’t produce effective results. It was developed to
detect the specific object in a real-time from a large number of objects. Most of the objects are designed to
scale many object systems. It has a problem when it detects two different objects with similar properties
such as color, texture but different In a physical way. To fix this problem there should be using different
algorithm but it will make the application very heavy.
8. CONCLUSION
The basics of object detection along with various ways of achieving it and its scope has been discussed.
Python has been preferred language in object detection for integrating whit OpenCV. If we talk about
another language MatLab, when a Matlab program is run on a computer, it gets busy trying to interpret all
that Matlab code as Matlab code is built on Java. OpenCV is basically a library of functions written in
C\C++. If we do research, then OpenCV is considered the best in object detection because it takes less time
to read objects from this library and also reduces coding.
Feature understanding and matching are the major steps in object detection and should be performed well
and with high accuracy. Face detection method that Haar-Cascade by most of the social applications like
Facebook, Twitter, Instagram, Smartphone face recognition, etc. In the coming time, OpenCV will be
popular for coders and IT companies. As we improve the performance of object detection, our detection
technique will also work fast.

Volume XII, Issue VI, June/2020 Page No:1240


Journal of Interdisciplinary Cycle Research ISSN NO: 0022-1945

9. REFERENCES
[1] Shijian Tang and Ye Yuan, “Object Detection based on Conventional Neural Network”.
[2] Shaikh, S.H; Saeed, K, and Chaki.N, “Moving Object Detection Using Background Subtraction”
Springer, ISBN:978-3-319-07385-9.
[3] “Opencv.org, About OpenCV‟, 2020. [Online]. Available:https://opencv.org/about/. [Accessed: 07-
Feb-2020].
[4] “Numpy.org, About NumPy”, 2020. [Online]. Available: https://numpy.org/about/. [Accessed: 11-Feb-
2020].
[5] “Keras.io, How to work”, 2020. [Online]. Available: https://keras.io/getting_started/. [accessed: 02-
Mar-2020].

Volume XII, Issue VI, June/2020 Page No:1241

You might also like