├── licence.jpg ├── licence_R.png ├── README.md └── OCR_Algo.py /licence.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Optical_Character_Reccognition/HEAD/licence.jpg -------------------------------------------------------------------------------- /licence_R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Optical_Character_Reccognition/HEAD/licence_R.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Optical Character Recognition 2 | 3 | ## NOTE:- I downloaded this image from Google,if you have any query or problem i can remove it, i just used it for Educational purpose. 4 | 5 | ### Code Requirements 6 | - Pytesseract 7 | - OCR should be install on your system 8 | 9 | ### What steps you have to follow?? 10 | - Download my repository 11 | - Run `OCR_Algo.py` and see the result. 12 | - Try with your own images. 13 | 14 | ### How it works? See:) 15 | 16 | ### Orignal image 17 | 18 | 19 | 20 | 21 | ### Output 22 | - it's screenshot of result 23 | - it's in string format, you can do anything with this information. 24 | 25 | \ 26 | 27 | 28 | ## Just follow☝️ me and Star⭐ my repository 29 | ## BUY This project which is implemented in WebApp using Flask(FULL WORKING) 30 | ## HERE is [STORE](https://www.instamojo.com/kushalbhavsar1820/ocr-webapp-using-flask-python) 31 | -------------------------------------------------------------------------------- /OCR_Algo.py: -------------------------------------------------------------------------------- 1 | import pytesseract ####reading string from image (OCR library) 2 | import numpy as np ##numpy for shape 3 | import cv2 #Computer vision library 4 | import os ##for remove image file which we edit during procedure 5 | pytesseract.pytesseract.tesseract_cmd='C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe' 6 | ###you need to install ocr and give path in program 7 | try: 8 | image='licence.jpg' 9 | print('Editing image for better OCR result..........') 10 | img = cv2.imread(image) ###reading image 11 | img = cv2.resize(img, None, fx=1.5, fy=1.5, interpolation=cv2.INTER_CUBIC) 12 | kernel = np.ones((1, 1), np.uint8) 13 | img = cv2.dilate(img, kernel, iterations=1) 14 | img = cv2.erode(img, kernel, iterations=1) 15 | new_image = 'edited' + '_' + image ###new image which we save during procedure 16 | cv2.imwrite(new_image, img) ###Save a new edited image 17 | read = pytesseract.image_to_string(new_image) ####reading from new generated image 18 | print(read) ##print resuult 19 | 20 | except Exception as e: 21 | print('please provide proper name of the image') 22 | print(e) 23 | --------------------------------------------------------------------------------