automeris-io / WebPlotDigitizer

Computer vision assisted tool to extract numerical data from plot images.
https://automeris.io
GNU Affero General Public License v3.0
2.67k stars 363 forks source link

Need Calibration For Image Which Don't Have Axis & Data Correction of Same Sheet #216

Closed HiddenJokar closed 4 years ago

HiddenJokar commented 4 years ago

Hi Dear Sir Big Fan Of You and Your Work. I Have Multiple Issue To Report Here 1- How to Add Axis if i have image / graph which dont have calibrated axis lik e this image Test 2 - If i have a graph which has three lines to trace but on the same axis why dont we have same data graph when ploted. only graph fits wel for one curve if we add data of second curve it gets distorted. Is there any way we have one graph multiple lines and have calibrated data points so that if we draw on one sheet it does not get distorted? regards

nbehrnd commented 4 years ago

To reply to your first question:

I would suggest you look for an image editor which is capable to read .jpg and may display for both horizontal and vertical direction a scale. In the example below, I used inkscape with the default dimension of pixels (px). As you equally see, inkscape's reference point for (x = 0, y = 0) is in the top-left corner.

at_origin

Now, inkscape has this pointer-button (left column). If activated, it allows you to determine (x,y) in inkscape's coordinate system of the image currently loaded. These values are reported in the bottom line. You have to note this tuple for the origin (picture above, here about (37, 432)). Then you do so for a reference point in the horizontal direction

x_axis

-- about (551, 433) --- and for one in the vertical dimension, too:

y_axis

-- about (36, 263).

Allowing integer numbers only, and converting it to the coordinate system used in your image, this is like an origin at (0,0), the reference for x at (515,0), and the reference for y at (0,170).

Feed these data to the digitizer when asked to calibrate x1, x2, y1, y2. Don't worry about stacking x1 on top of y1 -- the program is robust enough to remember them as two points which just happen to share the location of (0,0). Proceed as usual; select the colour of interest, pick a suitable pen width, and mark the trace which eventually will identify the curve:

extraction

The .zip below contains both the .cvs of one extracted curve, as well the project .tar to continue working on this. results.zip

I don't understand your second question well enough to equally answer this one. If you don't mind, please add an illustration.

HiddenJokar commented 4 years ago

Thank You So Much Sir @nbehrnd For Brilliant Explanation on fixing & calibration of Graph Axis. Sir i want to know as you trace curve 1, Trace second curve Too then draw these two curves on the same axis. one curve is drawn exactly as is graph but second curve is not same as in original figure. SO question is how can i draw these two above curves on the same axis by same calibration. because the x values of both curves are different. may be i'm unable to explain but i want these two exact curves on the same axis in Excel or some other graph plotting software. Here is the trace of both curves Default Dataset.zip

nbehrnd commented 4 years ago

As you mention a spreadsheet program as tool, and the two qualitative curves plot are described as proportional to a value derived from N, you may just create a table with four columns. Namely

At this point, plotting the two, you will recognize a need to move one of the two curves in vertical direction. Thus,

Or, exporting the spreadsheet as a .csv file, as in the documents attached below in the archive, you may reach out for a more programmatic approach like gnuplot, starting with set of instructions like below

set terminal svg`
set output 'testplot.svg'
set title 'testplot'
set xlabel 'N'
set ylabel '{\symbol F}'
set xrange [0:0.02]
set grid

plot 'test.csv' using 1:2 title 'curve A' with line, 'test.csv' using 1:4 title 'curve B' with line
exit

to yield a .svg you may process further e.g., in inkscape. This may be more portable than getting started in libraries like matplotlib.

test_set.zip

nbehrnd commented 4 years ago

Suggest @ankitrohatgi : Possibly the issue is resolved and this thread may be closed.