How to map the points of the graph from the coordinates on the image to the actual coordinates?

240 views Asked by At

I am implementing an auto-digitizer using Matlab to extract (x, y) value pairs of a line graph. I have determined the position of the axes and y-axis on the image by specifying the beginning and the end of each axis on the image. I also found the coordinates of the points on the graph image. Now how can I map those values to real values so that I can plot the graph again with the values I just mapped?

Here is my input image: enter image description here

I have defined the beginning and the end of the x,y axis (the red points in the figure below) and know the limit ranges of each axis. I have determined the coordinates on the image of the points of the graph (for example, with the green point in the image, I have determined the coordinates of its (281,70)). Now I want to convert from the coordinates on the image to the actual coordinates so that I can plot the graph again. What formula can help me do that?

enter image description here

1

There are 1 answers

0
Miscellaneous On

The x coordinate is pretty straight forward, subtract that of the point by that of the origin

x = x_on_image - x_origin;

For example, the x coordinate of the green point on the graph you shown is

x = 281 - 48;

The direction of y-axis of the image is inverted and is plotted in log scale. Put it back to the exponent of 10 can recover the original value, i.e.

y = 10^(y_origin - y_on_image);

For the green point

y = 10^(368 - 70);