Hello All,
I am using GET OCR ACTIVITY to fetch piece of data and compare.
I can able to compare number When It is 2 digit <like 12,15,25 > But not below 10. I am not getting solution. Kindly suggest.
Selector : <java name=‘Result: * Objects’ role=‘label’
Screen shot from application
Requirement : I just want to run loop till Result:8 Objects reached to “0” and maximum 25.
Regards,
VS01
HareeshMR
(Hareesh Madasi)
October 1, 2019, 9:40am
2
May be it is reading “0” as “(” or “)” @Santhoshi_Gvs
HareeshMR
(Hareesh Madasi)
October 1, 2019, 10:23am
4
Actually OCR’s are not 100% efficient. that error is based on the resolution of the screen or the scale in the OCR. If you want to get better results, go for Python tesseract which will give you 85 - 90 % accuracy
Are you asking me to use below
(upload://t7WcjUDYYuowkIRlDu6ANbTDnc0.png)
?
HareeshMR
(Hareesh Madasi)
October 1, 2019, 10:32am
6
Can you post the image again, it is missed.
I mean, use a piece of python code to get the text from imagw
How can Get the python code of this? < Sorry I do not know>
HareeshMR
(Hareesh Madasi)
October 1, 2019, 10:36am
8
here is the post for reference @Santhoshi_Gvs
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\Deepfi…
1 Like
Okay , I try to understand this and get back to you.
I do not know how to call py progms.
HareeshMR
(Hareesh Madasi)
October 1, 2019, 10:47am
10
Just install the package UiPath.Python.Activities @Santhoshi_Gvs
You will get the python activities available in the activities pane and just drag them
I tried , In code. From where I should invode this “exe” file. ?
pytesseract.pytesseract.tesseract_cmd = r"C:\Users\hamadasi\AppData\Local\Tesseract-OCR\tesseract.exe"
Where I have to define variable "filename " with absolute path ? , In uipath or in Python script?
HareeshMR
(Hareesh Madasi)
October 1, 2019, 11:27am
12
Yeah, you have to install that pytesseract module so that it will be in your local. Then you need to provide the path of that in the code
here filename is nothing but the image path you have. You need to pass it through arguments from the workflow @Santhoshi_Gvs
PlanviewUsingPython.xaml (6.7 KB)
use this for reference
Am I missing any plugins here?
HareeshMR
(Hareesh Madasi)
October 2, 2019, 5:51am
14
Have you installed uipath.python.activities @Santhoshi_Gvs ?
HareeshMR
(Hareesh Madasi)
October 2, 2019, 8:06am
16
PyhtonCode.zip (3.2 KB)
Can you check this @Santhoshi_Gvs
In script : What path I have to mention here , I do not have tesseract.exe" file anywhere.
Also for textfile ?
pytesseract.pytesseract.tesseract_cmd = r"C:\Users\hamadasi\AppData\Local\Tesseract-OCR\tesseract.exe"
textfile = open(r"D:\UIPath files\Time sheets\Attachments\Deepfieldglass.txt",“w+”)
textfile = open(r"D:\UIPath files\Time sheets\Attachments\Deepplanview.txt",“w+”)
HareeshMR
(Hareesh Madasi)
October 2, 2019, 12:32pm
18
tesseract you need to install @Santhoshi_Gvs
and text file is the path of the file where you are storing the text in the image
Hi Hareesh,
I used some other function to make it possible. Thank you for your support.
Regards,
Santhoshi GV