This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing modules | |
| import pytesseract | |
| from PIL import Image | |
| print(pytesseract.image_to_data(Image.open('planet.png'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing modules | |
| import pytesseract | |
| from PIL import Image | |
| #bounding box info | |
| print(pytesseract.image_to_boxes(Image.open('planet.png'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing modules | |
| import pytesseract | |
| from PIL import Image | |
| #reading french text from image | |
| print(pytesseract.image_to_string(Image.open('test-european.jpg'), lang='fra')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing opencv and pytesseract | |
| import cv2 | |
| import pytesseract | |
| img = cv2.imread("book_page.jpg") | |
| #Resize the image | |
| img = cv2.resize(img, None, fx=0.5, fy=0.5) | |
| #Convert image to grayscale | |
| gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| #Convert image to black and white |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing opencv | |
| import cv2 | |
| img = cv2.imread("book_page.jpg") | |
| #Resize the image | |
| img = cv2.resize(img, None, fx=0.5, fy=0.5) | |
| #Convert image to grayscale | |
| gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| #Convert image to black and white | |
| adaptive_threshold = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 85, 11) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing opencv | |
| import cv2 | |
| img = cv2.imread("book_page.jpg") | |
| #Resize the image | |
| img = cv2.resize(img, None, fx=0.5, fy=0.5) | |
| #Convert image to grayscale | |
| gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| #Convert image to black and white | |
| adaptive_threshold = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 85, 11) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #importing modules | |
| import pytesseract | |
| from PIL import Image | |
| # If you don't have tesseract executable in your PATH, include the following: | |
| pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract' | |
| #converting image to text | |
| print(pytesseract.image_to_string(Image.open('image.png'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dsad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class university: | |
| def __init__(self,name,department): | |
| self.name=name; | |
| self.department=deparment |