Optical Character Recognition (OCR) Of License Plates Using the KNN Method

Authors

  • Abim Tisanarada Prodi Teknik Infomatika, Universitas Buddhi Dharma, Tangerang, Banten Author
  • Yo Ceng Giap Universitas Buddhi Dharma Author

Keywords:

OCR, KNN, image detection, IoT, vehicle license plates

Abstract

This study aims to implement an IoT-based security system with character recognition (OCR). The OCR system utilizes a webcam and the KNN method to recognize vehicle license plate text in real-time. This prototype was tested using six samples of the latest Indonesian license plates. The character detection process involves steps such as capturing images from the webcam, preprocessing images to improve contrast and convert them to grayscale, and applying calibrated transformations. Image inversion and thresholding are performed to separate characters from the background. Character segmentation and filtering criteria are also performed to clean the character image from noise and remove inappropriate backgrounds. The detected characters are identified using Region of Interest (ROI) detection to ensure the validity of the characters. The validated contours are sorted from left to right to form the complete license plate number. Subsequently, KNN implementation is used to recognize the detected characters. Test results indicate that the KNN-based webcam license plate detection system, with K set to 1, performs well and achieves a sufficiently high level of performance. Testing at camera-to-license plate distances of 60 cm, 70 cm, and 80 cm shows an average accuracy rate of 100% within 5 seconds. This research contributes to the development of an efficient and accurate vehicle license plate recognition system for various applications, including parking systems and access control.

Downloads

Download data is not yet available.

References

[1] C. B. Asaju, P. A. Owolawi, C. Du, and E. Van Wyk, “Enhancing Security with Automated Boom Gate Access Through License Plate Recognition Utilising YOLOv8 Model,” in Communications in Computer and Information Science, Springer Science and Business Media Deutschland GmbH, 2025, pp. 181–197. doi: 10.1007/978-3-031-85856-7_15.

[2] Lubna, N. Mufti, and S. A. A. Shah, “Automatic number plate recognition:A detailed survey of relevant algorithms,” May 01, 2021, MDPI AG. doi: 10.3390/s21093028.

[3] J. F. Haryanto, J. M. Kristian, and R. Sutoyo, “Automatic Number Plate Recognition Performance Comparison In Old And New Indonesian License Plates Using Deep Learning,” ICIC Express Letters, vol. 18, no. 8, pp. 793–799, Aug. 2024, doi: 10.24507/icicel.18.08.793.

[4] N. Ali, M. Isheawy, and H. Hasan, “Optical Character Recognition (OCR) System,” IOSR Journal of Computer Engineering Ver. II, vol. 17, no. 2, pp. 2278–661, 2015, doi: 10.9790/0661-17222226.

[5] M. Arul Selvan, A. Gowtham, T. Haarish, K. Ram Kishore, S. Vignesh Ram, and S. Vignesh, “Real-Time License Plate Recognition and Validation System Through Image Processing and KNN,” International Journal of Innovative Research in Engineering, vol. 5, no. 6, pp. 8–10, 2024, [Online]. Available: www.theijire.comhttp://creativecommons.org/licenses/by/4.0/

[6] M. Lall and J. A. Van Der Poll, “A Z Specification for Reliability Requirements of a Service-based System,” 2020. [Online]. Available: www.ijacsa.thesai.org

[7] W. Purwanto and M. Septiani, “Implementasi Automatic License Plate Recognition untuk mengurangi pelanggaran lalu lintas berbasis Artificial Intelligence,” Informatics for Educators And Professionals : Journal of Informatics, vol. 8, no. 2, pp. 148–157, 2023.

[8] S. H. Park, S. B. Yu, J. A. Kim, and H. Yoon, “An All-in-One Vehicle Type and License Plate Recognition System Using YOLOv4,” Sensors, vol. 22, no. 3, Feb. 2022, doi: 10.3390/s22030921.

[9] B. H. Y. S. H. Dinda Rizki Taningrum, “Sistem Pengidentifikasian Plat Nomor Kendaraan Mobil Menggunakan Principal component Analysis Dan Klasifikasi K-NN,” e-Proceeding of Engineering, vol. 3, pp. 1868–1876, Aug. 2016.

[10] L. R. Mursari and A. Wibowo, “The Effectiveness of Image Preprocessing on Digital Handwritten Scripts Recognition with The Implementation of OCR Tesseract,” Computer Engineering and Applications, vol. 10, no. 3, pp. 177–186, 2021.

[11] N. D. Cahyo, “Pengenalan Nomor Plat Kendaraan Dengan Metode Optical Character Recognition,” Ubiquitous: Computers and its Applications Journal, vol. 2, pp. 75–84, 2019, doi: 10.51804/ucaiaj.v2i1.75-84.

[12] D. Rohpandi, A. Sugiharto, and G. A. Winara, “Aplikasi Pengolahan Citra Dalam Pengenalan Pola Huruf Ngalagena Menggunakan MATLAB,” Konferensi Nasional Sistem & Informatika, pp. 772–777, 2015.

[13] Kusnantoro, T. Rohana, and D. S. Kusumaningrum, “Implementasi Metode Tesseract OCR ( Optical Character Recognition ) untuk Deteksi Plat Nomor Kendaraan Pada Sistem Parkir,” vol. III, no. 1, pp. 59–67, 2022.

[14] A. Firdaus, S. Kurnia, T. Shafera, and W. I. Firdaus, “Implementasi Optical Character Recognition (OCR) Pada Masa Pandemi Covid-19,” Jurnal JUPITER, vol. 13, no. 2, pp. 188–194, 2021.

[15] X. Wu et al., “Top 10 algorithms in data mining,” Knowl Inf Syst, vol. 14, no. 1, pp. 1–37, 2008, doi: 10.1007/s10115-007-0114-2.

[16] V. Ong and D. Suhartono, “Using K-Nearest Neighbor In Optical Character Recognition,” ComTech, vol. 7, no. 1, pp. 53–65, 2016.

[17] R. M. R. Clinton and R. Sengkey, “Purwarupa Sistem Daftar Pelanggaran Lalulintas,” Jurnal Teknik Elektro dan Komputer Vol.8, vol. 8, no. 3, pp. 181–192, 2019.

[18] T. Dewangca, A. L. Prasasti, and R. E. Saputra, “Identifikasi Plat Nomor Kendaraan Menggunakan Metode K-Nearest Neighbor,” e-Proceeding of Engineering, vol. 7, no. 2, pp. 4650–4658, 2020.

[19] Burhanuddin, P. H. Siregar, and M. Rigayatsyah, “Deteksi Plat Nomor Kendaraan Bermotor Menggunakan Algoritma K-Nearest Neighbors (KNN),” Jurnal Teknologi Terapan & Sains, pp. 461–469, 2020.

Downloads

Published

2025-07-25

How to Cite

Optical Character Recognition (OCR) Of License Plates Using the KNN Method. (2025). Indonesian Applied Research Computing and Informatics, 1(1), 10-19. https://jurnal.tdinus.com/index.php/iarci/article/view/46