Horje
extract text from image python without tesseract Code Example
extract text from image python without tesseract
from PIL import Image
from pytesseract import pytesseract
  
# Defining paths to tesseract.exe
# and the image we would be using
path_to_tesseract = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
image_path = r"csv\sample_text.png"
  
# Opening the image & storing it in an image object
img = Image.open(image_path)
  
# Providing the tesseract executable
# location to pytesseract library
pytesseract.tesseract_cmd = path_to_tesseract
  
# Passing the image object to image_to_string() function
# This function will extract the text from the image
text = pytesseract.image_to_string(img)
  
# Displaying the extracted text
print(text[:-1])




Python

Related
fading hex color python Code Example fading hex color python Code Example
How to restart a loop Code Example How to restart a loop Code Example
search for file in a whole system Code Example search for file in a whole system Code Example
loop only to  the 6th element python Code Example loop only to the 6th element python Code Example
delete specific indeces from numpy array Code Example delete specific indeces from numpy array Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7