Obtaining numerical values of mathematical graphs with python

Asked

Viewed 676 times

0

Assuming you have a data file that allows you to plot a 2d graph (straight, parabola, conical), is it possible, starting from the image of the graph, to extract the numerical values that generated it? Is there a package, or technique in python that allows this?

Note: I know it is possible to extract text using Tesseract, but I could not solve the above issue.

1 answer

2

No, that’s not a trivial thing to do - and I don’t know any packages that can do that automatically.

Given a specific graphic image, it is possible to do this, of course, by taking some "handmade" measurements of the graph - that is, position of axes, scales, etc... and using programming just to know the position of the graph at each point, and using a rule of three, possibly with error propagation, to have the chart valroes.

From there, common methods of numerical analysis, using scipy, or even doing at hand can find the graph parameters.

If the graphics are all in the same style, it is possible to generalize such an approach enough to automate the task. If they are distinct graphics, then extra care in the "handmade" part, factor code to accept the measures taken manualmetne as parameters, and eventually extract them automatically from the image, and then yes, using Learning machinne technique to choose from various chart models (after knowing how to do "manually" each model) can automate the thing more generally.

Now realize that if you have the numerical data itself, and you want to arrive at the mathematical parameters that would generate a graph with that numerical data, this is a well-trodden field of physics/mathematics known as numerical regression, and something often used in research - but it has nothing to do with the extraction of data from arbitrary images: the formulas well consolidated for several decades need numerical data.

In short: package ready does not have. It is possible. But it takes work, and real work - so it depends on your need and availability of resources whether you go after it or not - and yet, it might be worth considering other ways of doing it. If it’s a few dozen graphs, it’s certainly worth an almost 100% manual approach (if you use some program on the computer to make it easier to take measures - but it could be a drawing program) + mathematical techniques. However, if you have the numbers and want the graph parameters, it’s a completely different and feasible job

Browser other questions tagged

You are not signed in. Login or sign up in order to post.