简体   繁体   中英

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

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: 在此处输入图像描述

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?

在此处输入图像描述

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, ie

y = 10^(y_origin - y_on_image);

For the green point

y = 10^(368 - 70);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM