Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read Text From Image
#1
I am new to Python and i want to extract text from Image, in the below i am getting some images text as same Image but some images are very good and easily readable but below code is not able to extract the text.

But when i use online link to extract text then the online tool is extracting all the text as it is from image.
Online Link : https://smallseotools.com/image-to-text-converter/

How can i handle to extract all text from images.

Note : I can;t share image publically

 

import io
import requests
import pytesseract
from PIL import Image, ImageFilter, ImageEnhance
pytesseract.pytesseract.tesseract_cmd = r"C:\Users\ADMIN\AppData\Local\Tesseract-OCR\tesseract.exe"
response = requests.get('https://www.google.com/7cb71799-3cd2-4bff-aeb7-7ff7ec7d371b.jpeg')
img = Image.open(io.BytesIO(response.content))
imagetext = pytesseract.image_to_string(img)
print(imagetext)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't read text file with pandas zinho 6 12,083 May-24-2020, 06:13 AM
Last Post: azajali43
  Can python read Marathi text files and summarize them? mcp111 0 1,823 Mar-18-2020, 08:58 AM
Last Post: mcp111
  Invoice scanning image/pdf into text animeshsarraf 1 2,097 May-24-2019, 12:12 PM
Last Post: johnb546
  [split] How do i read particular text from scanned documents ganeshsai2912 3 2,427 Nov-16-2018, 04:16 AM
Last Post: ganeshsai2912
  read multiple .xlsx files and text files in a directory BNB 11 25,674 Jun-07-2017, 07:42 AM
Last Post: BNB

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020