Extracting numeric table data from an image using Python - python

I want to extract numeric data from an image of a table (png/jpeg/etc.) using Python. I don't mind if it's some deep learning algorithm but it doesn't have to be if there is already an existing library.
I've tried various script that I found online. Most of them are some version of using cv2 and pytesseract. One such example is here here. It works for simple tables or sample files used in the algorithm description itself. However, they don't seem to work well for general tables that I want to process, one example is below.
Does anyone know any other table recognition scripts/libraries that I can just use out of the box? Thanks.

Related

How to extract data from tables in a pdf using Python?

I need to extract data from tables in multiple PDF's using Python. I have tested both camelot and tabula however neither of them are able to accurately get the data. The tables have some merged cells, cells with mutiple lines of information etc. so both these libraries get confused. Is there a good way of approaching this issue?
There may be something wrong with the underlying structure of the table encoded in the PDF if that's the case.
You could use OCR, and do some string/regex manipulation to extract column data from each row. github.com/cseas/ocr-table seems to work. See the input.pdf and output.txt to see if it works with your situation.

Is there a way on Python to extract a time series from an image?

I am trying to extract a time series dataset from an image (with x-axis and y-axis). Is there a quick way to do so on Python?
To be more precise, this is my graph:
HEL Share Price
and I am trying to get daily data.
Any help?
Thanks! :)
I know this Web App that can do it: WebPlotDigitizer
Looking at alternativeto.net I found Engauge Digitizer which "accepts image files (like PNG, JPEG and TIFF) containing graphs, and recovers the data points from those graphs" and a recent version "adds python support". I never used Engauge, but it sounds like what want...
Keep in mind, that it is not that easy to automate such a task, because finding the correct axis labels and "49,28" label even might overlap the graph sometimes...
In Python, you could try this Python3 utility. It says it can extract raw data from plots images.
But you can more easily extract data from graph images using GUI-friendly tools, like plotdigitizer.com or automeris.io. I prefer the former over the latter. You can find the entire list of such programs over here.

Is the any way to detect table with pytesseract

I have tried to extract table data from the image and insert to csv. I use by tesseract
can anyone tell me how to detect table data from the image
I have this image:
Check this open source library https://github.com/jsvine/pdfplumber. This has shown good promise in extracting table data. You will get the texts in the table as a list of lists which is very useful. Apart from that, you can get the coordinates of the cells also which gives provisions for any post-processing.
One drawback is that it works only for digital pdfs.

Capturing screenshot and parsing data from the captured image

I need to write a desktop application that performs the following operations. I'm thinking of using Python as the programming language, but I'd be more than glad to switch, if there's an appropriate approach or library in any other languages.
The file I wish to capture is an HWP file, that only certain word processors can run.
Capture the entire HWP document in an image, might span multiple pages (>10 and <15)
The HWP file contains an MCQ formatted quiz
Parse the data from the image that is separate out the questions and answers and save them as separate image files.
I have looked into the following python library, but am still not able to figure out how to perform both 1 and 3.
https://pypi.python.org/pypi/pyscreenshot
Any help would be appreciated.
If i got it correctly , you need to extract text from image.
For this one you should use an OCR like tesseract.
Before using an OCR, try to clear noises from image.
To split the image try to add some unique strings to distinguish between the quiz Q/A

Python - Best way to find similar images in a directory

Here is the effect I am trying to achieve - Imagine a user submits an image, then a python script to cycle through each JPEG/PNG for a similar image in the current working directory.
Close to how Google image search works (when you submit your image and it returns similar ones). Should I use PIL or OpenCV?
Preferably using Python3.4 by the way, but Python 2.7 is fine.
Wilson
I mean, why not use both? It's trivial to convert PIL images into OpenCV images and vice-versa, and both have niche functions that can make your life easier. Pair them up with sklearn and numpy, and you're cooking with gas.
I created the undouble library in Python which seems a match for your issue.
It uses Hash functions to detect (near-)identical images in for example a directory. It works using a multi-step process of pre-processing the images (grayscaling, normalizing, and scaling), computing the image hash, and the grouping of images based on a threshold value.

Categories