Professional Documents
Culture Documents
Implementation of Size-Based Recognition On Automatic Liquid Filling Machine Using Canny-Edge Detection Method
Implementation of Size-Based Recognition On Automatic Liquid Filling Machine Using Canny-Edge Detection Method
UIN Sunan Gunung Djati Bandung UIN Sunan Gunung Djati Bandung
Bandung, Indonesia Bandung, Indonesia Bandung, Indonesia
ahmadsasefulmilah56@gmail.com @gmail.com boimjeh@gmail.com
Abstract- liquid filling in small industries is often filled Automated filling equipment has become an essential
manually into containers, resulting in the liquid being poured symbol of industrial modernization. The implementation
into the container inaccurately, making it inefficient in cost and proposed by [1] using a Programmable Logic Controller
time. This paper proposes an edge detection method to (PLC), the research develops and implements an automatic
automatically detect objects based on the size of 2 bottles for bottle filling system based on a programmable logic controller
filling machines in soap liquid. The proposed process involves using a DELTA PLC (DVP 14SS), which serves as a field
image processing stages using edge detection and filling machine controller and runs the designed prototype by detecting the
control stages. The results showed that. The use of Dilated and presence of the bottle on a conveyor belt and filling it
Erode Image operations also helps to improve the detection and appropriately up to a predetermined level[2]. Automatic liquid
segmentation of 2 bottle sizes accurately. The detected bottle
filling was the subject of research by Hidayat and Winahyu,
sizes are 10ml and 20ml, with 10ml being 5.4cm high and 2.0cm
wide and 20ml being 7.7cm tall and 3.3cm wide. By examining
who developed a method for creating a small, effective device
the overall performance of the filling machine, this study proves employing a keypad start button, flow sensor, temperature
that edge detection based on object size is a practical and sensor, fan, buzzer, LCD 1602, and relay driver. [3]. But this
essential approach in machine vision. The proposed edge system does not yet use the machine vision method, so filling
detection method has great potential to improve the quality of is only done for 1 type of bottle.
segmentation and object detection in various image processing
With the background of computer vision technology
applications.
developed rapidly in recent times, an automated filling system
Keywords: edge detection method, filling machine object has been designed to solve this problem[4]. In general, the
detection, image processing, segmentation. term "computer vision systems" refers to techniques that
extract desirable features from digital images. The basic goal
I.! INTRODUCTION of these systems is to improve scene comprehension from
input photos. Machine vision refers to the use of vision
The manual refilling of liquids into containers is a systems in manufacturing environments to automate
common practice in small enterprises, particularly for the production operations. [5], [6].
liquid filling sector (such as mineral water, tea, liquid milk,
juice, etc.). The fluid that is put into the containers as a result Abdullah et al. proposed a system that uses a camera to
is erroneous, which can result in losses in terms of money and gauge the liquid level at any time during filling. The camera
time. The continual liquid filling activity in the container will can accurately identify the fluid level using the image process
greatly cut industry earnings and prevent Small and Medium technique (Edge Detection Approach) [7]. One of the crucial
steps in image processing is edge detection. Edge detection's
Enterprises (SMEs) from expanding in the future as the
primary objective is to locate and extract the borders or edges
cumulative losses result become more excellent. Therefore,
between various objects in a picture. [8]. The edges generated
we require a tool that can measure liquid volume accurately, by the edge detection process can be used to identify objects
efficiently, and at a reasonable cost. Device installation and in an image. We can classify objects based on their
operation must be simple and practical for small-scale characteristics by extracting edge features and applying
business owners who are not tech savvy. Since it doesn't need pattern recognition techniques. It is crucial in many
a lot of installation area, the owner's company can set it up applications, such as facial recognition[9], crop vehicle
quickly. recognition [10], satellite image recognition [11], etc.
Before a machine for filling liquids using a One of the most used edge detection techniques in image
microcontroller that could accurately fill liquids was processing is canny edge detection. The technology of Canny
developed, workers had to fill bottles by hand manually. The edge detection can provide exceedingly precise edges. A
automatic filling machine will reduce this loss and labor costs gradient operator that measures the shift in pixel intensity in
and eliminate another problem faced by the industry, different directions is used to achieve it.[12]. Compared to
especially in the liquid soap production industry. other edge detection methods, such as Sobel or Prewitt
"#"$%$&'(&$('()$"*)&*+&,-((!.)()&!/000
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.
operators, Canny edge detection can produce smoother and properties and properties. Many image processing techniques
clearer edges by reducing the effects of noise and increasing are applied to digital images to extract information from the
edge sharpness. The Canny edge detection method has proven examined image. As shown in Fig. 2, the primary image
effective and widely used in various image processing processing procedure consists of three main steps: Pre-
applications. This technique is commonly used in object processing, image segmentation, and feature extraction [6].
segmentation, pattern recognition, computer vision, and
medical image processing applications because of its high
accuracy and capacity to produce accurate edges. [13].
This research is expected to create an automatic liquid-
filling machine that can recognize the container's shape
accurately and efficiently using Canny-edge feature-based
recognition technology. The results of this research can
significantly contribute to improving the performance of
automatic liquid filling machines and supporting the Fig.2. Image processing procedure.
development of automation technology in the production
industry. The first step in image processing is image capture.
Scientific photo or image processing can be done effectively
II. RESEARCH METHOD using scanned images or data from digital cameras. After pre-
Machine vision, which is concerned with the acquisition processing, the first step of image analysis, image
of visual data and how computers perceive it, is related to the segmentation, is required. Segmentation divides the image
methods in this work. A typical vision system comprises of a into different parts that have the same features or show some
computer, the hardware and software required to connect similarities. Edge detection techniques are used to find
with it, cameras and digital devices, and so forth. Three discontinuities in grayscale images. The proposed work
functions, namely sensing and digitizing image data, image implements the Canny-edge detection method in the
processing and analysis, and controlling and decision-making detection process. The block diagram of the canny-edge
systems, make up the system's design. detection method used in this study is shown in Fig.3.
The relationship between the three functions is illustrated
in the diagram in Fig.1.
Erode Image
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.
Fig.4. Liquid filling machine system block diagram.
The system program built with OpenCV Python includes The results of the bottle size are used as objects in the
several processes. The first step is real-time image capture hardware system for filling liquid soap. The results of the
using a camera webcam, as shown in Fig.5. The next step is overall implementation of this system are shown in Fig.6.
the image pre-processing stage. The image is selected using This tool uses a webcam for image processing to detect two
the edge detection method. Next goes the size-based object- bottles measuring 10ml and 20ml—Nodemcu as a
matching identification process sent to the NodeMCU microcontroller that controls the servo motor as a conveyor
microcontroller based on serial communication. The output drive. Nodemcu also has a water flow sensor, ultrasonic
of the system processing will send a command for filling soap sensor, and relay for filling in the liquid filling machine
liquid once the system correctly detects the size-based image. system.
A. Edge Detection Implementation And Analysis
The first process run on the liquid filling machine system
for filling soap is image processing. Some stages of image
processing include the actual image, Grayscale Image,
Gaussian Blur Image, Thresholding Image, Canny Image,
Edge Image, Dilated Image, and Fillled Image. Based on their
size, these stages detect bottle images using the Python
programming language. Before entering the image
processing stage, the original image is obtained from the
webcam in real time, shown in Fig.7.
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.
_, thresholded_image = cv2.threshold(blurred_image,
threshold_value, max_value, cv2.THRESH_BINARY) canny_image = cv2.Canny(thresholded_image, 50, 100)
dilated_image = cv2.dilate(canny_image, None,
The original image is converted to Grayscale Image using iterations=1)
cv2.cvtColor() with parameter cv2.COLOR_BGR2GRAY eroded_image = cv2.erode(dilated_image, None,
iterations=1)
resulting in a grayscale image (Fig. 8). Gaussian Blur using
cv2.GaussianBlur(). The second parameter (9, 9) specifies
The cv2.Canny() function is used to detect image edges
the kernel size, which controls the degree of smoothing (Fig.
by applying edge detection sensitivity based on the threshold
9). Thresholding uses cv2.threshold(). The first parameter is
value (Fig. 11). Dilated Image uses cv2.dilate() with the
the image to be threshed (in this case, the Gaussian Blur result
specified kernel to strengthen the edge lines (Fig. 12). The
image), the second parameter is the threshold value used, the
kernel value does not need to be filled in numerically as it is
third parameter is the maximum value to be assigned to pixels
sufficient to write None as it already gets the required result.
that exceed the threshold, and the fourth parameter is the
The erosion method to remove the edge flesh uses cv2.erode()
thresholding method used which is cv2.THRESH_BINARY
with the kernel written None. It helps to obtain a neater and
(Fig. 10).
smoother edge line (Fig. 13).
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.
The conveyor system is driven by a servo motor with a
rotating direction. This conveyor directs the bottle right in
front of the ultrasonic sensor, which will stop the rotating
rate. At times like this, the bottle detection system will
validate the bottle size between 10ml and 20ml. At the
detection of a 10ml bottle size, relay one automatically turns
on and turns on the water flow calculated by the water flow
sensor according to the size of the bottle, likewise, with the
size of 20ml. Filling each bottle that has been completed
drives the servo motor back to rotate the conveyor. The test
results of this soap-filling system are shown in TABLE II.
Fig. 15. Automatic liquid filling machine system flowchart. Fig. 16. The result of bottle sizes.
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.
The results show that when using an appropriate threshold, [6] A. Bhargava and A. Bansal, “Fruits and vegetables quality
the edge detection method can produce clear and well-defined evaluation using computer vision: A review,” J. King Saud Univ. -
Comput. Inf. Sci., 2018, doi: 10.1016/j.jksuci.2018.06.002.
edges on objects of the desired size. The use of Dilated and [7] O. I. Abdullah, W. T. Abbood, and H. K. Hussein, “Development
Erode Image operations also helped to improve the accuracy of Automated Liquid Filling System Based on the Interactive
of detection and segmentation of the two bottle sizes Design Approach,” FME Trans., vol. 48, no. 1, pp. 938–945, 2020,
accurately. The detected bottles are 10ml and 20ml in size. doi: 10.5937/fme2004938A.
The 10 ml bottle has a height of 5.4cm and a width of 2.0 cm. [8] Y. Wu and Q. Li, “The Algorithm of Watershed Color Image
Segmentation Based on Morphological Gradient,” Sensors (Basel).,
The 20 ml bottle has a height of 7.7 cm and a width of 3.3 cm. vol. 22, no. 21, Nov. 2022, doi 10.3390/S22218202.
In testing the overall performance of the filling machine, [9] R. P. Rizki, E. A. Z. Hamidi, L. Kamelia, and R. W. Sururie, “Image
processing technique for smart home security based on the principal
this study proves that edge detection based on object size is a component analysis (PCA) methods,” Proc. - 2020 6th Int. Conf.
practical and essential approach in image processing. The Wirel. Telemat. ICWT 2020, pp. 2–5, 2020, doi:
proposed edge detection method has great potential to 10.1109/ICWT50448.2020.9243667.
improve the quality of object segmentation and recognition in [10] V. Dworak, M. Huebner, and J. Selbeck, “Precise Navigation of
various image processing applications. Small Agricultural Robots in Sensitive Areas with a Smart Plant
Camera,” J. Imaging, vol. 1, pp. 115–133, 2015, doi:
10.3390/jimaging1010115.
REFERENCES [11] R. Bausys, G. Kazakeviciute-Januskeviciene, F. Cavallaro, and A.
Usovaite, “Algorithm Selection for Edge Detection in Satellite
Images by Neutrosophic WASPAS Method,” Sustain. 2020, Vol.
[1] R. Ambare, S. R. Lende, P. R. Arote, O. B. Pokharkar, and G. R.
12, Page 548, vol. 12, no. 2, p. 548, Jan. 2020, doi:
Waykar, “Design And Development Of Automatic Bottle Filling
10.3390/SU12020548.
Machine,” 2019.
[12] N. M. Syahrian, P. Risma, and T. Dewi, “Vision-Based Pipe
[2] M. Liton Ahmed, S. Kundu, and M. Rafiquzzaman, “Automatic
Monitoring Robot for Crack Detection Using Canny Edge
Bottle Filling System Using PLC Based Controller,” J. Adv. Mech.,
Detection Method as an Image Processing Technique,” Kinet. Game
vol. 4, no. 1, 2019.
Technol. Inf. Syst. Comput. Network, Comput. Electron. Control,
[3] R. Hidayat and H. S. Winahyu, “Automatic Liquid Filling Machine
pp. 243–250, Sep. 2017, doi: 10.22219/KINETIK.V2I4.243.
using Flow Sensor and Arduino Pro Mini,” Indones. J. Eng. Res.,
[13] L. Liu, F. Liang, J. Zheng, D. He, and J. Huang, “Ship infrared
vol. 1, no. 1, pp. 27–31, Oct. 2020, doi: 10.11594/IJER.01.01.05.
image edge detection based on an improved adaptive Canny
[4] S. Roy, C. T. Hazera, D. Das, R. M. S. Rahman Pir, and A. S.
algorithm,” Int. J. Distrib. Sens. Networks, vol. 14, no. 3, Mar. 2018,
Ahmed, “A Computer Vision and Artificial Intelligence Based
doi:
Cost-Effective Object Sensing Robot,” Int. J. Intell. Robot. Appl.,
10.1177/1550147718764639/ASSET/IMAGES/LARGE/10.1177_
vol. 3, no. 4, pp. 457–470, Dec. 2019, doi: 10.1007/S41315-019-
1550147718764639-FIG3.JPEG.
00107-1/METRICS.
[14] N. Suresh Kumar, S. Margret Anouncia, and M. Prabu,
[5] Y. Chen, K. Chao, and M. S. Kim, “Machine Vision Technology
“Application of Satellite Remote Sensing to Find Soil Fertilization
for Agricultural Applications,” Comput. Electron. Agric., vol. 36,
by Using Soil Colour,” Int. J. Online Eng., vol. 9, no. 2, pp. 44–49,
pp. 173–191, 2002.
2013, doi: 10.3991/ijoe.v9i2.2530.
Authorized licensed use limited to: Consortium - Algeria (CERIST). Downloaded on March 16,2024 at 11:52:42 UTC from IEEE Xplore. Restrictions apply.