Here is the JPG image of a cheque , from where I wanted to extract only MICR code and IFSC code.
I have tried Screen scarping and Tesseract OCR but not getting exact value as marks in Image. can some one help please ?
Hi @Srinibash_Dash,
Welcome to the community
The image seems to be pretty clear, but the OCR isn’t always the right way to extract data as it’s hit and trial as per requirement
Do the following:
- Try different OCR’s present such as Microsoft, Google (both are free)
- Try checking how they are getting the values
- Once you reach a good understanding which one is good, pick it for all the images
Hope this helps
Good day.
If you use python tesseract, you will be able to get far better results than those microsoft and tesseract users @Srinibash_Dash
Correct Hareesh, we are getting better result , but getting like
.
Can you please suggest any way to convert it back to original value
yup , Tesseract ocr
tesseract OCR is google ocr, but you need to write a piece of code to use python OCR
Hmmm… that might take some time for me. But will try it out definitely.
Thanks a ton for the input
This is the actual code I have, here I’m reading a image and extracting all the text on the screen. To read that, I used python tesseract and storing the text in a text file. I hope you know how to call python code and pass the parameters to it @Shubham_Varshney
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r"C:\Users\hamadasi\AppData\Local\Tesseract-OCR\tesseract.exe"
#filename = 'D:\Python screenshot\Deepfieldglass.png'
def ocr_core(filename = None):
if filename is None:
#filename = 'D:\Python screenshot\Deepfieldglass.png'
return "file name is null"
text = pytesseract.image_to_string(Image.open(filename)) # We'll use Pillow's Image class to open the image and pytesseract to detect the string in the image
textfile = open(r"Text file path","w+")
textfile.write(text)
#return text.encode("utf-8")
return "Successful"
#print(ocr_core(filename))
@Hareesh, still not recognizing MICR code correctly. I learnt about Xebia - cheque analysing solution but not finding any related activity in Packager Manager !
Hi, Would you be able to provide more detail please?
I’ve never used Python with UiPath before
thanks
Just install the package UiPath.Python.Activities @qwerty1
You will get the python activities available in the activities pane and just drag them
HI Hareesh,
can you help me on the same.I am unable to import pytesseract .
I am not able to download it.can you sent any link.
Yes done
I am searching for python code for extracting micr code for the community project. Pls. help me with code. yuvraj.thapa@outlook.com