简体   繁体   English

map如何将图形上的点从图像上的坐标到实际坐标?

[英]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.我正在使用 Matlab 实现自动数字化仪,以提取线图的 (x, y) 值对。 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.我通过指定图像上每个轴的开始和结束来确定图像上轴和 y 轴的 position。 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?现在我怎样才能将这些值 map 转换为实际值,以便我可以用我刚刚映射的值再次 plot 图表?

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.我已经定义了 x,y 轴的起点和终点(下图中的红点),并且知道每个轴的极限范围。 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)).我已经确定了图形点的图像上的坐标(例如,对于图像中的绿点,我已经确定了其 (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.现在我想将图像上的坐标转换为实际坐标,以便我可以再次 plot 图形。 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 = x_on_image - x_origin;

For example, the x coordinate of the green point on the graph you shown is例如,您显示的图表上绿点的x坐标是

x = 281 - 48;

The direction of y-axis of the image is inverted and is plotted in log scale.图像的 y 轴方向被反转并以对数比例绘制。 Put it back to the exponent of 10 can recover the original value, ie把它放回10的指数可以恢复原值,即

y = 10^(y_origin - y_on_image);

For the green point对于绿点

y = 10^(368 - 70);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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