Python Forum

Full Version: Image Processing in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all

I wanted to get the communities advice on a python project I am considering on embarking on.

I have a PDF file that contains approx 50 pages each page containing a graph/plot.

Along the top and bottom of the page is text and various values which is used to isolate a specific page and portion of the plot.

I would like to import the PDF say an image, using a function pass in some text and some numbers, python would then loop through each page of the PDF until it finds the text and numbers.

Once it finds it, some text and a circle is placed at the location of where the text/numbers were found.

Is this something that is even possible?

I would love to hear your thoughts?

Thanks
Here's something to whet your appetite:

PDF's are a pain in general.

One reason has to do with images that are from photographs, which may or may not include text.
The text from these types of pages is notoriously difficult to extract, but can (with extreme effort) be done with some OCR (optical character recognition) software. There are packages available for free that do this, but they are only mediocre at best. Even most of the Commercial products struggle with this type of content.

Pure converted text is much easier to deal with (caveat: may require extensive tweaking to get text positions on some documents), especially if the text is arranged in tables.

There are several packages available to deal with this type of conversion.
I have used most all of them.

The most common are:
The graphics portion is actually the easier (not not easy) part.

I would consider wxpython or PyQt5 as the graphics package
wxpython is 100% free, and the latest (phoenix) version is very robust

Qt5 is arguably the most advanced graphics package for python, but royalty and other fees may be involved with
some commercial uses.