Adil Khan 5 years ago

Extract CNIC Details from Image using Python

Python Script to Extract CNIC Details from Image 

# -*- coding: utf-8 -*-
 """
 Created on Fri Jan 8 17:38:24 2021
@author: AdilKhan
 This script will extract CNIC From a Scanned CNIC Image
 """
# import the necessary packages
 import pytesseract
 import cv2
 import imutils
pytesseract.pytesseract.tesseract_cmd = r'C:Program FilesTesseract-OCR	esseract.exe'
imgPath = 'YOUR SCANNED CNIC IMAGE ADDRESS'; #SCANNED CNIC IMAGE PATH
 image = cv2.imread(imgPath) # READING/OPENING THE IMAGE
 cv2.imshow('Actual Image',image)
 cv2.waitKey(0)
 image = imutils.resize(image,1024,665) #RESIZING THE IMGE
 image = image[200:250,360:650] #SLICING THE CNIC NUMBER PART FROM IMGAE
 cv2.imshow('Image Slice',image)
 cv2.waitKey(0)
 gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) #CONVERTING THE IMAGE INTO GRAY SCALE
 gray = cv2.threshold(gray,50, 2255,cv2.THRESH_BINARY)[1]
 text = pytesseract.image_to_string(gray)[0:15] #CONVERTING IMAGE TO TEXT
 print("CNIC:",text) 

 

Extract CNIC Details from Image using Python _ 0.zip

Download: Extract CNIC Details from Image using Python _ 0.zip

0
3.0K
Autonomous and Portable sun-tracking solar energy harnessing system

An Autonomous and Portable sun-tracking solar energy harnessing system, is a power system...

1675638330.png
Adil Khan
1 year ago
IOT based patient health monitoring system through smartphone

the  project is about the designing of biomedical kit that detect the vital signs in&...

1675638330.png
Adil Khan
1 year ago
Location Based Alarm

Our proposed system is location based alarm system that provide ease for the mobile users....

1675638330.png
Adil Khan
1 year ago
Alternating Current To High Voltage Direct Current

Our project is based on alternating current to high voltage direct current as we can see i...

1675638330.png
Adil Khan
1 year ago
Designing of an Efficient Electrooculogram (EOG) Based Human-Computer...

This Final Year Project (FYP) aims to design and implement a Human-Computer Interface (HCI...

1675638330.png
Adil Khan
1 year ago