how to extract text from very small image using python opencv
Hi All,
I'm new bee for python openCV, can you help me to extract text from small image.Can you check my uploaded image.
i have tried Below code, But i'm not getting expected result.
import sys
import cv2
import numpy as np
import pytesseract
img = Image.open("TestImge.PNG")
pytesseract.pytesseract.tesseract_cmd = 'F:\\Python27\\Tesseract-OCR\\tesseract'
print(pytesseract.image_to_string(img))
my Expected output Is
Show the following Claims
But i'm getting
Sltowvcololovangccrno
my image
my second image
Help me to done.
Thanks,
You should try first with synthetic image : write "Show the following Claims" using a small font and use png format to save your image. Don't use jpg format
To ask a better formatted question in the future, please format the code and output as preformatted text (the icon is the 0 1 0 1 0 1 one). I've just done this for you. This is done with three spaces at beginning of line. Thanks for actually including code as text rather than a screenshot!
@LBerger,Thanks for response,i will try and let you know,
@opalmirror,Thanks for your help.
@LBerger,still i'm getting same problem,is their any alternate way.
can you edit your message and insert synthetic image in png ?
@LBerger,Sorry for the delay,please check my edited post.
Upper image is "my image" (zoom x4) : it's a color image. lower image is image in gray (cvtColor) : I don't know how to extract character in your image.
@LBerger,my upper image is sipping from existing windows forms ,but my second image is created synthetic image .That's why different background colours.
@LBerger,Removing background colour and extracting only text is also more helpfull to me.