OCR KTP
OCR (Optical Character Recognition) KTP (Kartu Tanda Penduduk) is a machine learning-based solution to extract character information on a KTP image.

OCR Check Flow

  1. 1.
    Image Requirement Check: The system checks the image requirement such as image size, resolution size, and image quality. The image size checking ensures the KTP size is not larger than 2 MB. The resolution size checking asserts the KTP object dimension is above 300 x 400 px to assure that its text is clear and recognizable.
  2. 2.
    KTP alignment: The system detects the KTP object position and align the KTP into frontal view to enhance text recognition.
  3. 3.
    Normalization and Template Matching: This process corrects the recognized text through normalization and template matching to check the possibility of matched keywords from our database.

OCR Requirement Check Image Input Specification

The submitted image input should fulfill the minimum requirements below:
Image Setting
Requirement
Minimum camera pixel
Above 2 MP
Image file size
The minimum size is 100 KB and the maximum is 2 MB
Image compression recommendation
Bicubic, with minimum JPEG quality 80%
Image dimension
Minimum dimension is 300 x 400 px with no max dimension

Feature Explanation

Segmentation

The segmentation system groups the parts of an image that belong to the same object. In the Nodeflux OCR KTP case, the segmentation model looks for pixels that belong to the KTP to know where OCR should be executed. The OCR performs more efficiently by restricting its scope to only the KTP region and ignoring the unnecessary background.
We use a deep learning segmentation model trained using various KTP data. Implementing segmentation process improves the accuracy and robustness of the OCR system.

Image Quality Assessment

Image Quality Assessment (IQA) evaluates the quality of an image into several quantized attributes, such as sharpness, brightness, and specularity. It works by applying filters that quantize the quality of an image.
This quantization denotes a value that informs whether an image is of acceptable quality or not. IQA returns True if the image fulfills the parametric condition and False if it is not.
Here are the details of each IQA attribute:
  • Specularity: Indicates the algorithm find spotlights or glares. The value false indicates the presence of a spotlight/glare in the image.
  • Brightness: Informs lighting conditions of the image. The value is true if the image is in ideal lighting conditions and false if the image is too dark or too bright.
  • Sharpness: Describes the clarity of detail in the image. The value is false if the image is blurry.
The image quality information will be informed on the API response, please check the response structure below:
1
{
2
"job": {
3
"id": "<job_id>",
4
"result": {
5
"status": "success",
6
"analytic_type": "OCR_KTP",
7
"result": [
8
{
9
"nik": "104671030308920003",
10
"nama": "AGIAR PUTRI DIANA",
11
"agama": "ISLAM",
12
"rt_rw": "005/003",
13
"alamat": "BATUCEPER TIMUR",
14
"provinsi": "BANTEN",
15
"kecamatan": "BATU CEPER",
16
"pekerjaan": "KARYAWAN SWASTA",
17
"tempat_lahir": "LEBAK",
18
"jenis_kelamin": "PEREMPUAN",
19
"tanggal_lahir": "07-06-1994",
20
"berlaku_hingga": "SEUMUR HIDUP",
21
"golongan_darah": "B",
22
"kabupaten_kota": "KOTA TANGERANG",
23
"kelurahan_desa": "BATUCEPER",
24
"kewarganegaraan": "WNI",
25
"status_perkawinan": "BELUM KAWIN",
26
"image_quality": {
27
"sharpness": true,
28
"brightness": true,
29
"specularity": true
30
}
31
}
32
]
33
}
34
},
35
"message": "OCR_KTP Service Success",
36
"ok": true
37
}
38
Copied!

Template Matching

Template matching is a process to compare the texts recognized by OCR with a set of templates. It is used to handle typos or misrecognized characters of OCR. The process works by calculating the similarity between a recognized text with every word template using mathematical formulas. After that, it selects the template with the highest similarity as the correction for the text. These processes improve the accuracy of the OCR system.