I need to provide AADHAAR card photo and need to extract the Data on AADHAAR and display in JSON with masking partial Unique AADHAAR Number
from PIL import Image
from pytesseract import pytesseract
#Define path to tessaract.exe
path_to_tesseract = r'C:/Program Files (x86)/Tesseract-OCR/tesseract.exe'
#Define path to image
path_to_image = 'C:/Users/PJ185101/Documents/images/sample2.jpg'
#Point tessaract_cmd to tessaract.exe
pytesseract.tesseract_cmd = path_to_tesseract
#Open image with PIL
img = Image.open(path_to_image)
#Extract text from image
text = pytesseract.image_to_string(img)
print(text)