extract specific text from image by using easyocr - python-3.x

I use easy OCR to extract text from images, and it works well for me. However, I need to remove shaded numbers from the extracted text result. I need to erase text if it's shaded.
Any help?? For example in the following picture, I need to delete "2586" and extract only "2574"

Related

Extract text from a pdf using coordinates in python

I have a pdf file containing text and tables. I want to extract text from some region of interest (ROI).
I used pdfplumber to get the desired starting and ending coordinates. Then, I tried to crop the PDF between these coordinates and extract text but couldn't succeed as though the cropped pdf has only text from ROI but apparently the pdfstream is still holding all the info for that particular page. As a result when I am extracting it is giving me text from the whole page (of the original pdf). I don't want to convert cropped pdf into image and apply OCR on top of it due to chances of inaccuracy. Any help on how to extract text using those coordinates is very much appreciated. Thanks in advance

get colored text in pdf file

I have a pdf include some MCQ questions and the right answer is colored and underlined
so I want to extract all the answer from the pdf and put them in the last page
I use pyPDF2 to transport the text from the pdf to a text.txt file
now I want to know how to get words in color or underlined from pdf with python
then I can put them in a list and to what I want
so, what can I use in order to do that ?

Build a image from multiple images

I have multiple images (more than 1000 / 288*288) with their respective coordinates (X,Y).
All pictures put together should displayed a unique picture. However some picture are missing.
Would it be possible to create a blank picture (via an array taken max(Y) and max(X)) and put each picture in the appropriate place?
Thanks
Try this: https://note.nkmk.me/en/python-pillow-concat-images/
It is a python library to work with images. You can create a blank image and then paste your images there.

change text color or highlight text with multiple colors using python

I am trying to read the pdf and highlight some sub-strings in pdf, and i am able to achieve it using python libraries PYPDF2 and fitz
but i wanted to make to highlight/ change text with different colors and retain the layout of the original pdf,
please advice on this, thank you
We can't change the textcolor of words inside the pdf but we can use the
highlight annot
with default color("yellow"),
if need more colors we need to make the
square annot
using pymupdf lib, this worked for me in python

How do I start the index to a different position in a text file?

What I am trying to accomplish is to extract specific text from a text file.
Currently what this code outputs is that if parsed, it will display extracted text in a messagebox. It will extract the first 500 characters from the text file and display it in a little messagebox.
The problem is that it starts from the beginning of the text file to extract the text. What I want it to do is to search for the text that states "SUMMARY" in the text file and start from there to extract the first 500 characters.
I believe the problem is that I am missing some necessary code and I'm hoping someone can help me provide it for me please.
Dim start_index As String = "SUMMARY"
If parse() Then
MsgBox(tariff.Substring(0, 500))
Else
MsgBox("Failed to parse.")
End If

Resources