An Embedded Real-Time Object Detection and Measurement of Its Size
An Embedded Real-Time Object Detection and Measurement of Its Size
net/publication/330728646
CITATIONS READS
14 7,710
4 authors, including:
Mehmet Karakose
Firat University
133 PUBLICATIONS 1,400 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Mehmet Umut Salur on 30 January 2019.
Abstract— In these days, real-time object detection and object. The reference object always is the left-most object in
dimensioning of objects is an important issue from many areas of the image. Also, to calibrate your pixels per metric variable,
industry. This is a vital topic of computer vision problems. This the reference object can be utilized and from there, calculate
study presents an enhanced technique for detecting objects and the size of other objects in all frames [5]. Completely
computing their measurements in real time from video streams. computational procedures are assessed through a raspbian
We suggested an object measurement technique for real-time
operating system using a raspberry pi 3 running with a
video by utilizing OpenCV libraries and includes the canny edge
detection, dilation, and erosion algorithms. The suggested frequency of 1.3 GHz [6-10]. Every processes utilize the
technique comprises of four stages: (1) identifying an object to be libraries of OpenCV [11].
measured by using canny edge detection algorithm, (2) using We have found various papers attached to a measurement
morphological operators includes dilation and erosion algorithm system. Each measurement applications are utilized for various
to close gaps between edges, (3) find and sort contours, (4) purposes. A movable outdoor distance measurement system
measuring the dimensions of objects. In the implementation of was proposed and 90% precision were obtained [12]. The
the proposed technique, we designed a system that used OpenCV distance was measured by utilizing through utilizing S3C2410.
software library, Raspberry Pi 3 and Raspberry Camera. The For this purpose, a temperature reparation module was used to
proposed technique was nearly achieved 98% success in
improve the accuracy [13]. An ultrasonic distance
determines the size of the objects.
measurement system was proposed for embedding distance
Index Terms— Object Detection, Object Dimension measurement [14]. The sizes of objects in an image are
Measurement, Computer Vision, OpenCV, Raspberry pi 3, estimated by using computer vision methods [15].
Canny Edge Detection.
II. TTIME OBJECT -HE PROPOSED METHODOLOGY FOR REAL
DETECTION AND MEASUREMENTS
I. INTRODUCTION
The system consists of two parts which are object
Real-time object detection and measurement systems are
detection and object measurement. In the first part, raspberry
very vital tasks in the industrial process. Object detection is
pi camera used to achieve the frames. In the second part,
often used in product quality stages in the industry. The
computer vision module will be applied to the captured frames
proposed system can be applied to an industrial quality control
to determine the objects, then, we will measure each object.
system. Likewise, it can be utilized for various industrial
The detected object of the current frame immediately will be
systems or for security purposes. Generally, it is identifying
processed to extract dimensions of objects.
objects in public area and measure dimensions of each of
In the proposed system, firstly, we need to preprocess our
them.
image. The camera will capture a frame and the frame will
The competence of the proposed system has been
convert to grayscale to increase quickness and accuracy.
confirmed through utilizing real videos that taken from a
Objects are detected via canny edge detector algorithm. It is
Raspberry Pi camera. The execution of this procedure has a
used to detect only one object or multiple objects. By the help
high computation rate and it is dependent on the resolution of
of canny edge detector, the converted image will be processed.
frames. The achievement of identifying objects and separate
The canny edge algorithm scans the entire image. After that,
these objects from the background is perfect [1-4].
execute dilation and erosion algorithm to close holes among
To calculate the size of each object, firstly we need to
edges in the edge frame [16-18]. Figure 1, shows that the flow
determine the reference object. After that, the dimensions of
chart for the recommended system.
the reference objects will be used to calculate the size of other
objects. We calibrate the camera according to the reference
Object Identification
Object Measurement
See the Output on the Screen The final stage of canny edge detector algorithm is
hysteresis thresholding. This stage selects which are every
Figure 1. Flowchart for proposed method edges are surely edges and which aren’t edges. The two
threshold values are empirically selected and their definition
Figure 2, shows the input frame that used for canny edge will upon on the content of a given frame. This is achieved via
detection. First stage in canny edge detector algorithm is choosing big and small threshold values. If Edge pixels
delete the noise in the frames by applying a Gaussian filter. stronger than the big threshold, it is marked such as sturdy.
The frame after converting to gray scale and apply Gaussian Strong edges will be measured as the last edges. Also, edge
filter is appeared in Figure 3. pixel will be suppressed If an edge pixels weaker than the
small threshold, and it is marked as weak edge if an edge pixel
among the big and small thresholds.
To obtain the better result and more accurate object
detection, the canny edge detection procedure has been
improved with some Morphological operations [19]. These
procedures are commonly a combination of nonlinear
procedures performed relatively on the preparation of pixels
without changing their numeral values. erosion and dilation
are the keys for morphological operations.
In this study, a morphological process is performed such as
Figure 2. Input frame
a mixture of dilation and erosion. The opening is the initial
procedure in which erosion is followed through dilation.
Closing is the second operation in which dilation is followed
through erosion. As a mixture of these processes we are
capable to acquire superior determination for discovery edges
in-depth frame. Figure 5 shows that the frame after applying
erosion and dilation operation.
In this study, an powerful real time object measurement [11] G. Bradsky, A. Kaehler, “Learning OpenCV, Computer Vision with the
method is proposed for industrial systems. In the offered OpenCV Library” (Book Style), O’Reilly Media, Sebastopol, CA, 2008.
system, Computer Vision used to detect and measure objects. [12] Y. Jang, S. Shin, J. W. Lee, and S. Kim, “A preliminary study for
The system can detect and measure objects in a real time portable walking distance measurement system using ultrasonic
video. After the object has been detected by using canny edge
sensors,” Proceedings of the 29th Annual IEEE International
detector, the size is obtained for each object by using OpenCV
functions. We enhanced the canny edge detector algorithm Conference of the EMBS, France, Aug. 2007, pp. 5290-5293.
through utilizing Morphological operations. This procedure [13] H. He, and J. Liu, “The design of ultrasonic distance measurement
benefits to eliminate extra noises. Furthermore, whereas system based on S3C2410,” Proceedings of the IEEE International
eliminating the extra noises it likewise smoothens the shape Conference on Intelligent Computation Technology and Automation,
and keeps the outline and size of each object. Thus, the
Oct. 2008, pp. 44-47.
outlines of the different objects in the scene were kept.
The proposed technique works very fast and five frames [14] D. Webster, “A pulsed ultrasonic distance measurement system based
can be processed pending one second. Raspberry Pi 3 used to upon phase digitizing,” IEEE Transaction on Instrumentation and
implement the systems since it has very great features and low Measurement, Vol. 43, No. 4, Aug. 1994, pp. 578-582.
cost embedded equipment platform. [15] Kainz, O., Jakab, F., Horečný, M. W., & Cymbalák, D. (2015, October).
REFERENCES Estimating the object size from static 2D image. In Computing and
[1] Muthukrishnan.R and M.Radha “Edge Detection Techniques for image Communication (IEMCON), 2015 International Conference and
Segmentation” International Journal of Computer Science & Workshop on (pp. 1-5). IEEE.
Information Technology (IJCSIT) Vol3, No 6, Dec 2011. [16] Z. Xu, X. Baojie and W. Guoxin, "Canny edge detection based on Open
[2] Geng Xing, Chen ken , Hu Xiaoguang “An improved Canny edge CV," 2017 13th IEEE International Conference on Electronic
detection algorithm for color image” IEEE TRANSATION ,2012 978-1- Measurement & Instruments (ICEMI), Yangzhou, 2017, pp. 53-56.
4673-0311-8/12/$31.00 ©2012 IEEE. doi: 10.1109/ICEMI.2017.8265710
[3] Chen.W, Yue.H, Wang.J, Wu.X. An improved edge detection algorithm [17] I. M. O. Widyantara, N. M. Ary Esta Dewi Wirastuti, I. M. D. P. Asana
for depth map in painting. Optics and Lasers in Engineering 2014;55: and I. B. P. Adnyana, "Gamma correction-based image enhancement
69–77. and canny edge detection for shoreline extraction from coastal
[4] Moeslund T. Canny Edge detection. Denmark: Laboratory of Computer imagery," 2017 1st International Conference on Informatics and
Vision and Media Technology,AalborgUniversity. 〈http://www.cvmt.dk/ Computational Sciences (ICICoS), Semarang, 2017, pp. 17-22.
education/teaching/f09/VGIS8/AIP/canny_09gr820.pdf〉 [March 2009]. [18] Y. y. Zheng, J. l. Rao and L. Wu, "Edge detection methods in digital
[5] OpenCV, 2016. http://opencv.org/.[Accessed December 23, 2016]. image processing," 2010 5th International Conference on Computer
[6] I. Aydin and N. A. Othman, "A new IoT combined face detection of Science & Education, Hefei, 2010, pp. 471-473.
people by using computer vision for security application," 2017 [19] Morphological image analysis. Principles and applications by Pierre
International Artificial Intelligence and Data Processing Symposium Soille. ISBN 3-540-65671-5 (1999), 2nd edition (2003).
(IDAP), Malatya, 2017, pp. 1-6.