pISSN: 2723 - 6609 e-ISSN: 2745-5254
Vol. 5, No. 8 August 2024 http://jist.publikasiindonesia.id/
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3133
Automatic Reading System of Scale Values on Webcam-
Based Measuring Vessel
Budi Yasri
1*
, Gianto
2
, Rossi Aulia Rachmawati
3
Akademi Metrologi dan Instrumentasi, Indonesia
Email:
*Correspondence
ABSTRACT
Keywords: reading error,
automatic reading,
measuring vessel, image
processing, webcam
camera.
The fuel measurement pump is an installation used to
measure the quantity of liquid fuel (BBM) to be sold or
delivered to consumers. In the transaction of buying and
selling fuel at gas stations, the fuel measurement pump plays
a crucial role. Therefore, this measuring device needs to be
calibrated or re-verified, and supervision is carried out using
a standard measuring vessel with capacities of 10 L or 20 L.
Errors in reading the measuring vessel can occur due to
differences in individual visual acuity. To address this issue,
a prototype for automatic reading of measuring vessels is
created using a webcam camera. This prototype utilizes the
Raspberry Pi 3 B+ as an image processor and the Logitech
C270 webcam as an image capturer. The image processing
process involves segmentation steps, transforming the image
into a grayscale and then into a binary image. This research
involves two different types of fluids in the volume
measurement of the measuring vessel, namely distilled water
(equates) and petalite. The measurement results with the
prototype show an average accuracy level of around 99,23%,
an average precision level of about 99,37%, and an average
error rate of about 0,77%. For the equated fluid, the
accuracy, precision, and error levels are 99,48%; 99.76%;
and 0,52%, respectively. Meanwhile, for the petalite fluid,
the accuracy, precision, and error levels are 98,98%;
98,80%; and 1,02%, respectively.
Introduction
Fuel demand in Indonesia continues to increase in line with the growth of motor
vehicles and the spread of petrol stations (Putri, Novita, & Maskar, 2022). In fuel
transactions, measurement accuracy is an important factor. For this reason, fuel gauge
pump measuring instruments must be marked and re-marked as well as periodic
supervision (Sinaga, 2017). This activity is usually carried out by volumetric method
using a standard measuring vessel (BUS) as the standard. A measuring vessel is a volume-
measuring instrument that serves as a reference in testing other volume-measuring
instruments (Buana, 2018).
Budi Yasri, Gianto, Rossi Aulia Rachmawati
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3134
However, differences in the ability to read the BUS scale by the individual eye can
result in reading errors (Pertiwi & Setyawan, 2020). Therefore, an automatic reading
prototype using the camera sensor is required. Previous research has tried using ultrasonic
sensors and capacitive sensors, but it still has limitations (Adriansyah, GM, & Yuliza,
2014).
The study used camera sensors to capture BUS-scale images, which were then
processed automatically (Irmayanti & Andini, 2019). This enables accurate automatic
readings and generates evidence in the form of images for surveillance activities. The test
results show that this prototype is effective in improving the accuracy of BUS
measurements at petrol stations (Laoli, 2018). Thus, the use of camera sensor technology
can be a solution to improve measurement accuracy in fuel transactions at petrol stations
and facilitate supervision by metrology supervisors.
Figure 1. System block diagram
Research Methods
In the prototype of the reading of the scale value on the measuring vessel, a method
was carried out by simulating synthetic images. The synthetic imagery is made to
resemble the image of a measuring vessel captured by a webcam. This image is made to
resemble the colour of a petalite liquid, which is green.
Figure 2. Synthetic imagery
Figure 3. Image of the acquisition using a webcam camera
Automatic Reading System of Scale Values on Webcam-Based Measuring Vessel
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3135
The image processing techniques used are as follows:
1. Pre-processing, preparing the correct camera position and determining the appropriate
ROI (Region of Interest) to be detected by the camera.
2. The segmentation process, changing the RGB image to a grayscale image which is
then changed again to a binary image (black and white).
3. Post-processing, image analysis by detecting black pixels using the principle of liner
interpolation then calculating what volume the meniscus point is at with equation (1)
as follows.
Results and Discussion
Simulation Results
In this study, a simulation was carried out using synthetic images as shown in Figure
2 which aims to determine the reliability of the program that has been made. This
synthetic image is made to resemble the original image taken using a webcam camera. In
the synthetic image that has been made, the ROI image contains at least a liquid meniscus
object in the glass of the measuring vessel and scale lines on the glass wall, which is -50
mL to 50 mL (Zahara, 2019).
After that, the synthetic image that has been created is tested using the programming
in the prototype to obtain the results of the volume reading on the measuring vessel. In
synthetic images, the meniscus line is at a volume of 25 mL. Meanwhile, in prototype
programming, it reads 25 mL (Alfonsius et al., 2023). This indicates that the prototype
can run well because it has successfully read artificial images. The reading results have a
difference of 0 mL.
This image processing uses several stages of image processing. First, the
segmentation stage by changing the RGB colour image to grayscale or grayscale.
Figure 4 Segmentation of RGB images to grayscale images
After that, for the image to be at a certain threshold, the adaptive threshold method
is carried out. This method is performed to convert a grayscale image into a binary (black-
and-white) image taking into account the pixel intensity in about each pixel. This helps
in overcoming uneven lighting variations across the imagery (Abdi, 2020). In this process,
the grayscale image will be changed to black or white only, where black will have a binary
value of 0 while white will have a value of 1. This is shown in the meniscus producing
Budi Yasri, Gianto, Rossi Aulia Rachmawati
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3136
the colour black. In programming, the detected black colour is considered a black pixel.
The detected black pixels are marked with a red dot that has x coordinates of 290.
Figure 5. Results of segmentation of grayscale images to binary images
Next, linear interpolation is carried out to determine the volume read on the glass
glass of a standard measuring vessel. This interpolation is a method for estimating the
value between 2 previously known points on a straight line of black pixels of scale. The
reference used to determine the value of the detected meniscus black pixel is the black
pixel on the artificial scale.
Figure 6. Reading results
It is known that the value of the px coordinate is 193 pixels. In addition, the start
and end of the pixels are 193 and 211 pixels, and then the start and end of the mL values
are 10 mL and 5 mL. Thus, the value of the meniscus point in the volume is obtained as
follows.
Volume = 10 mL + (5 -10) mL x (193 - 193) Px / (211 - 193) Px
Volume = 10 mL - 5 mL x (0) / (18)
Volume = 10 mL - 0 mL
Volume = 10 mL
The simulations that have been carried out using synthetic images, show that the
image processing carried out has succeeded in reading the volume of liquid on the
measuring vessel. The results of the prototype reading showed the same results as the
Automatic Reading System of Scale Values on Webcam-Based Measuring Vessel
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3137
synthetic images that had been made. In addition, synthetic images have also been made
at other meniscus points and produced an error range of 0 mL at 11 meniscus points,
namely 25 mL to -25 mL with a difference of 5 mL at each point.
Experiment Results
Synthetic image processing has been successfully carried out. Furthermore, the
researcher conducted a direct test with real images using 2 different liquids, namely
equates and petalite. Viewed in Figure 7, a real image with liquid equates reads 10 mL.
That way, the results read by the prototype are not much different from the manual
reading, which is 10 mL.
(a) (b) (c) (d)
Figure 7
Aquades (a) RGB imagery (b) Grayscale imagery (c) Binary imagery (d) Imagery
(a) (b) (c) (d)
Figure 8
Pertalite (a) RGB image (b) Grayscale image (c) Binary image (d) Image processing
results
Viewed in Figure 8, a real image with petalite liquid reads 10 mL. That way, the
results read by the prototype are not much different from the manual reading, which is 10
mL.
Conducting experiments using 2 different liquids, will prove the reliability of the
prototype in taking volume readings on different liquid colours. In addition, petalite is a
type of fuel so it has different properties and densities compared to equates. In the
calibration of the measuring vessel, equate liquid is used. That way, in addition to being
able to be used for surveillance and re-stamping purposes, this prototype can also be used
for calibration purposes.
Conclusion
In this study, a prototype of an automatic reading system for scale values on a
measuring vessel using a webcam camera has been made, where this prototype can
automatically read the volume of the measuring vessel on equates and petalite liquids
through the integration of prototype-supporting hardware and software to be able to detect
meniscus points through image processing with OpenCV Python.
Method validation for the prototype has been carried out by comparing the readings
on the prototype with manual readings or references using a nonius scale of a measuring
Budi Yasri, Gianto, Rossi Aulia Rachmawati
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3138
vessel with an accuracy of 0.5 mL and an artificial line with an accuracy of 0.05 mL.
Based on the results of the method validation, the prototype reading has approached the
manual reading.
The measurement of the volume of the measuring vessel with the automatic reading
prototype has an average accuracy rate of 99.23%; the average precision is 99.28%; and
the average error is 0.77%. In equates liquid, the level of accuracy, precision, and error is
99.48%; 99,76%; and 0.52%. Meanwhile, in petalite liquid, the level of accuracy,
precision, and error is 98.98%; 98,80%; and 1.02%. Not only used for surveillance
activities but the prototype can also be used for calibration of measuring vessels because
the prototype can take readings with adequate liquid.
Automatic Reading System of Scale Values on Webcam-Based Measuring Vessel
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 8, August 2024 3139
Bibliography
Abdi, Paki Abror. (2020). Pengaruh Kualitas Pelayanan Terhadap Kepuasan Konsumen
Pada SPBU Zacky Muhammad Pekanbaru. Universitas Islam Riau.
Adriansyah, Andi, GM, Mirzanu Rizki, & Yuliza, Yuliza. (2014). Rancangbangun dan
Analisa Cctv Online Berbasis Raspberry Pi. SINERGI, 18(2), 105110.
Alfonsius, Eric, Johannes, Albani Boutje, Mantiri, Roma Nouke Frets, Manahampi,
Romei, Hihola, Maharani, & Hadiwidjaja, Angelica Christy. (2023). Sistem
Informasi Geografis Letak Persebaran Tempat Pengisian Bahan Bakar Kendaraan
Tingkat Retailer Menggunakan Google API. Information System Journal, 6(02), 76
85.
Buana, I. Komang Setia. (2018). Aplikasi untuk pengoprasian komputer dengan
mendeteksi gerakan menggunakan opencv python.
Irmayanti, Tiara, & Andini, Khairunnisa Desi. (2019). Prototipe kontrol level otomatis
berbasis sensor ultrasonik dan variabel speed control pompa pada pengisian bejana
ukur standar. Akademi Metrologi dan Instrumentasi.
Laoli, Desimeri. (2018). Penerapan Algoritma Hill Cipher Dan Least Significant Bit
(LSB) Untuk Pengamanan Pesan Pada Citra Digital. Jurnal Ilmu Komputer Dan
Sistem Informasi (JIKOMSI), 1(2), 3040.
Pertiwi, Mas Ninda, & Setyawan, Galih. (2020). Bejana Ukur Standar Dengan Tampilan
Digital Menggunakan Sensor Kapasitif Berbasis Arduino Nano. Simetris: Jurnal
Teknik Mesin, Elektro Dan Ilmu Komputer, 11(2), 437447.
Putri, Almira Devita, Novita, Dian, & Maskar, Sugama. (2022). Pengenalan Wawasan
Bisnis Di Era Digital Bagi Siswa/I Smk Yadika Bandarlampung. Journal of Social
Sciences and Technology for Community Service (JSSTCS), 3(2), 213217.
Sinaga, Anita Sindar R. M. (2017). Implementasi Teknik Threshoding Pada Segmentasi
Citra Digital. Jurnal Mantik Penusa, 1(2).
Zahara, Alfan Nawaziru. (2019). Penentuan kadar emas menggunakan metode
interpolasi Lagrange. Universitas Islam Negeri Maulana Malik Ibrahim.