Skip to content

Instantly share code, notes, and snippets.

View JavierTorregrosa92's full-sized avatar

Javi Torregrosa JavierTorregrosa92

View GitHub Profile
@akash-ch2812
akash-ch2812 / Crop_and_OCR.py
Last active May 4, 2023 10:27
Crop and image first and then apply OCR
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\Akash.Chauhan1\AppData\Local\Tesseract-OCR\tesseract.exe'
# load the original image
image = cv2.imread('Original_Image.jpg')
# get co-ordinates to crop the image
c = line_items_coordinates[1]
# cropping image img = image[y0:y1, x0:x1]