Automated Data Extraction From Student Id Cards (KTM) Using Optical Character Recognition (OCR) And Regular Expressions Based On TKINTER GUI
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.
Downloads
Copyright (c) 2026 Andes Putra Gunawan, Yulia Darmi, Ardi Wijaya, Yuza Reswan

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.




.png)
