0% found this document useful (0 votes)
225 views5 pages

An Embedded Real-Time Object Detection and Measurement of Its Size

Uploaded by

Thong Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views5 pages

An Embedded Real-Time Object Detection and Measurement of Its Size

Uploaded by

Thong Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/330728646

An Embedded Real-Time Object Detection and Measurement of its Size

Conference Paper · September 2018


DOI: 10.1109/IDAP.2018.8620812

CITATIONS READS

14 7,710

4 authors, including:

Nashwan Adnan Othman Mehmet Umut Salur


Knowledge University Gaziantep Islam Science and Technology University
8 PUBLICATIONS   116 CITATIONS    18 PUBLICATIONS   60 CITATIONS   

SEE PROFILE SEE PROFILE

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:

ProjectSelect a project or enter the title of a new one View project

High Performance Computing Research Center View project

All content following this page was uploaded by Mehmet Umut Salur on 30 January 2019.

The user has requested enhancement of the downloaded file.


An Embedded Real-Time Object Detection and
Measurement of its Size
Nashwan Adnan OTHMAN Mehmet Umut SALUR Mehmet KARAKOSE Ilhan AYDIN
Computer Engineering Computer Engineering Computer Engineering Computer Engineering
Department Department Department Department
Firat University Harran University Firat University Firat University
Elazig, Turkey Sanliurfa, Turkey Elazig, Turkey Elazig, Turkey
[email protected] [email protected] [email protected] [email protected]

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

978-1-5386-6878-8/18/$31.00 ©2018 IEEE


carried out to keep every local maximum in the gradient
Begin picture, and removing the whole thing else. Figure 4, shows
that the frame after apply non-maximum suppression.
Capture frame

Object Identification

Object Measurement

Save on local storage

Figure 4. Input frame apply non-maximum suppression

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.

Figure 3. Grayscale and Smoothed input frame

In the compute gradient stage, we detect the edge gradient


and direction for each pixel. For the define the gradient at
every pixel of smoothened frame, Sobel operator utilized.
A complete scan of frame will be done afterward receiving
gradient magnitude and direction, to eliminate any undesirable Figure 5. Input frame after apply dilation & erosion operation
pixels which might not establish the edge. In this stage, just
local maxima must be considered as edges through applying To briefly summarize object measurement, after edge
Non-maximum suppression. Non-maximum suppression detection and close any gaps between edges, we detect
exchanges the smoothed edges in the frame of the gradient contours by using an OpenCV function that is
magnitudes to sharp edges. Non-maximum suppression is cv2.findContours to find the shapes of the objects in the edge
map. We arrange contours from left to right. The reference Figure 8, illustrates the object detection and
object in the frame is permanently the left one. By depending measurements. The size of each object in the frame which are
to the reference object, we calibrate the camera and set the calculated.
value of parameter. Next, we scan every contours, begin
looping above every individual contours. After that, the
rectangle around objects will be drawn in green. So, the points
of the bounding box rectangle will draw in a small purple
rounds. After that, we can get midpoints because the bounding
box is ordered. Finally, we calculate pixels Per Metric variable
through dependence on reference object. The height-distance
in pixels will put on hD (height) variable and width distance
will put on wD (width) variable. Then, we calculated the Figure 8. Calculate the size of objects
Euclidean distance among sets of center points.
In the first experiment we measured size of objects such as
III. RESULTS EXPERIMENTAL
white glasses, orange cup, bottle, potatoes. Table I, shows the
We proposed the system to measure objects in a real time accuracy of proposed object measurement system for these
video and pictures. We prepared a few experimental setups to objects. Abbreviations in the table are as follows; AM-H:
test the correctness of the proposed method. The implement Actual Measure-Height, PM-H: Proposed Measure-Height,
the proposed system has made by the help of Python language. AM-W: Actual Measure-Width, PM-W: Proposed Measure-
Figure 6. show that the setup of the prepared system. Except Width.
the hardware formation, the software’s required has installed.
TABLE I. ACCURACY OBJECT MEASUREMENT FOR ONE FRAME
Name of AM-H PM-H AM-W PM-W Accuracy
objects (cm) (cm) (cm) (cm) (%)
White glasses 10.0 10.5 6.8 7.1 % 95.45
Orange cup 8.5 9.0 7.5 7.4 % 97.56
Bottle 15.2 14.9 7.4 7.3 % 98.23
Potatoes 4.8 5.0 7.4 7.6 % 96.82

Nevertheless, not every results are perfect, since this is due


to the seeing angle and lens deformation. By calibrate the
camera and set good width parameter, accuracy will be
increase.
In the second experiment, we set the camera above the
objects. Figure 9, shows that the results of the object detection
Figure 6. Setup of proposed system and measurement for another objects. And the Table II,
demonstrations the accuracy values among actual measure and
For the experiment the camera has been effectively system measure.
capturing the pictures. The proposed system applies four
operations such as record frames, find edges, find objects, and
measure size for each objects. When we run the application,
the output screen displays on the PC screen as appear in
Figure 7.

Figure 9. Experimental result when camera above the objects

Figure 7. Display output on the screen


TABLE II. ACCURACY OBJECT MEASUREMENT WHEN CAMERA [7] N. A. Othman and I. Aydin, "A new IoT combined body detection of
ABOVE THE OBJECTS people by using computer vision for security application," 2017 9th
Name of AM-H PM-H AM-W PM-W Accuracy
International Conference on Computational Intelligence and
objects (cm) (cm) (cm) (cm) (%)
Communication Networks (CICN), Girne, 2017, pp. 108-112.
Turk kurus 1.7 1.7 1.7 1.8 % 97.14
[8] Raspberry Pi, 2015. https://www.raspberrypi.org.[Accessed may 4,
Mouse 10.0 10.1 5.2 5.7 % 96.20
2015).
Card reader 3.8 3.8 1.7 1.8 % 98.21
[9] Virginia Menezes, Vamsikrishna Patchava, M. Surya Deekshith Gupta,
Peace of paper 4.6 4.7 1.2 1.3 % 96.66
"Surveillance and monitoring system using Raspberry Pi and
tray 12.6 12.9 12.6 13.0 % 97.29 SimpleCV", 2015 International Conference on Green Computing and
Charger 7.6 7.6 3.7 3.9 % 98.26 Internet of Things (ICGCIoT), vol. 00, no. pp. 1276-1278, 2015,
plaster 4.4 4.4 4.4 4.2 % 97.72 doi:10.1109/ICGCIoT.2015.7380661.
[10] Ms. RenukaChuimurkar, Prof. Vijay Bagdi, “Smart Surveillance
The result for error column displays very low errors. The Security &Monitoring System Using Raspberry PI and PIR Sensor”,
error rate is especially smaller when camera above the objects. International Journal of Scientific Engineering and Applied Science
IV. CONCLUSION (IJSEAS) – Volume-2, Issue-1, January 2016 ISSN: 2395-3470

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.

View publication stats

You might also like