Jurnal Media Computer Science
Vol 5 No 4 (2026): Oktober

Automated Data Extraction From Student Id Cards (KTM) Using Optical Character Recognition (OCR) And Regular Expressions Based On TKINTER GUI

Andes Putra Gunawan (Universitas Muhammadiyah Bengkulu)
Yulia Darmi (Universitas Muhammadiyah Bengkulu)
Ardi Wijaya (Universitas Muhammadiyah Bengkulu)
Yuza Reswan (Universitas Muhammadiyah Bengkulu)



Article Info

Publish Date
28 Oct 2026

Abstract

This research aims to design and implement an automatic data extraction system from student ID card (KTM) images using a combination of Tesseract-based Optical Character Recognition (OCR) and Regular Expression, with a graphical user interface built using Tkinter. The developed system consists of an image preprocessing stage (text-zone cropping, skew correction with protection against textured backgrounds, and Otsu binarization), OCR text extraction using a multi-source and multi-page-segmentation-mode strategy, and data field extraction using tiered Regular Expression patterns supported by a keyword-mapping dictionary for the Study Program and Faculty fields. Testing was conducted on 100 student ID card images from Universitas Muhammadiyah Bengkulu using confusion matrix evaluation metrics, namely Precision, Recall, F1-Score, and Accuracy for each data field. The test results show that the system achieved an overall accuracy of 93.8%, with a Precision of 94.86%, Recall of 98.72%, and F1-Score of 96.75%. Per-field accuracy results show that the Student ID Number (NPM) field reached 100%, Faculty 98%, Study Program 95%, Place/Date of Birth 94%, and Name 82%. This research also identified and resolved a cross-platform issue in the OCR library that caused the loss of spaces and punctuation marks in the extraction results when run on the Windows operating system. The findings indicate that the combination of OCR and Regular Expression, specifically designed to match the visual characteristics of student ID cards, is able to produce an accurate and reliable data extraction system suitable for supporting academic administration processes.

Copyrights © 2026






Journal Info

Abbrev

jmcs

Publisher

Subject

Computer Science & IT

Description

Jurnal Media Computer Science merupakan jurnal nasional yang diterbitkan oleh Universitas Dehasen Bengkulu sejak tahun 2022. Jurnal Media Computer Science memuat artikel hasil-hasil penelitian di bidang Komputer, Sistem Informasi dan Teknologi. Jurnal Media Computer Science berkomitmen untuk menjadi ...