Library for extract infomation from thai personal identity card
Project description
ThaiPersonalCardExtract
Library for extract infomation from thai personal identity card. imprement from easyocr and tesseract
Examples
Real image file.
wrapPerpective image crop.
keypoint of image detected.
Resutls of library extract region of interest
|
|
---|---|
|
|
|
|
|
Installation
Install using pip
for stable release,
pip install thai-personal-card-extract
For latest development release,
pip install git+git://github.com/ggafiled/ThaiPersonalCardExtrac.git
Note 1: for Windows, please install tesseract first by following the official instruction here https://medium.com/@navapat.tpb/734dae2fb4d3 On medium website, be sure to setup already.
Note 2: for Linux os, please install tesseract by following the official instruction https://github.com/tesseract-ocr/tesseract
Usage
from ThaiPersonalCardExtract import PersonalCard
reader = PersonalCard(tesseract_cmd="D:/Program Files/Tesseract-OCR/tesseract") # for windows need to pass tesseract_cmd parameter to setup your tesseract command path.
result = reader.extractInfo('examples/card.jpg')
print(result)
Output will be in list format, each item represents result of library can extract, respectively.
{
"Identification_Number": "9999999999999",
"FullNameTH": "นาย อายุมฺมุราเสะ",
"NameEN": "Me Shoys",
"LastNameEN": "Hinata",
"Birthday": "421 fun. 1998",
"Religion": "พุทธ",
"Address": "ท๒ 99/1 มิชีโฮะ เขตฮานามิกาวา อำเภอชิบ;"
}
Config Options
you can set options to Instance by below keyword
Parameter name | Value Type | Example |
---|---|---|
lang | Enum of PersonalCardLanguage Class | PersonalCardLanguage.THAI \n PersonalCardLanguage.ENGLISH *Default is 'th' |
template_threshold | Double | Rate to cals similarity of template *Default is 0.7 |
sift_rate | Int | Feature Keypoint rate *Default is 25,000 |
tesseract_cmd | String | Path of your tesseract command **For windows only. |
save_extract_result | Boolean | Set True if you want to save extracted image *Default is False |
path_to_save | String | Path that you given it save extracted image, relative with save_extract_result=True |
Donate Me ☕
Mr.Nattapol Krobklang
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for thai-personal-card-extract-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3870e1470c1555943b6b71efe5c2068d4d320a39195f27887426a849d43ff2c7 |
|
MD5 | 0137f6057b215785ee5d7803a67adcc0 |
|
BLAKE2b-256 | 7814b95ee44c9c27fbc4331cec05bae16c6ccbdaae5880ae074b8c9f1bd5e974 |
Hashes for thai_personal_card_extract-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d520247c90aa1cb1064616dc6af1a1f3eeff68dc58687c0ef39c209913573f68 |
|
MD5 | 560f86b83ece7ef935e79781f4cad72d |
|
BLAKE2b-256 | 0b42eb4b18de41e93f3e530ba7f131f2d56817aac05dd71b7eb625adea795947 |