Obtaining numerical values of mathematical graphs with python

0

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

Note: I know that it is possible to extract text using tesseract, but I have not been able to solve the above question.

    
asked by anonymous 17.02.2016 / 22:01

1 answer

2

No, this is not a trivial thing to do - and I do not know any packages that can do this automatically.

Given a specific chart image, you can do this, of course, by taking some "handcrafted" measures from the chart - that is, positioning the axes, scales, etc ... and using programming only to know the position of the graph at each point, and use a rule of three, possibly with error propagation, to get the values of the graph.

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

If the graphics are all in the same style, you can generalize such an approach enough to automate the task. If they are distinct graphics, then extra care in the "handmade" part, factorize code to accept the measurements manually as parameters, and eventually extract them automatically from the image, and then yes, use machinne learning technique to choose from among several graphical models (once you know how to "manually" do each model) can automate the thing in a more general way.

Now realize that if you have the numerical data itself, and want to arrive at the mathematical parameters that would generate a graph with those 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: formulas well consolidated several decades ago need numerical data.

In short: Ready packet does not have. It's 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 even then, it might be worth considering other ways to do that. If there are a few dozen graphs, it's certainly worth a nearly 100% manual approach (even if you use some program on your computer to make it easier to take action - but it could be a drawing program) + mathematical techniques. However, if you have the numbers and want the parameters of the graph, it is a completely different and doable work

    
20.02.2016 / 17:43