小编Nil*_*was的帖子

使用 Python 查找图像中两点之间的物理距离

我有图像的两个坐标 (x, y)

Point N: (x = 2314, y = 751), Width = 2880, Hight = 2304
Point S: (x = 1533, y = 670), Width = 2880, Hight = 2304
Run Code Online (Sandbox Code Playgroud)

当我在 matplotlib 中绘制它们时,它们看起来像这样。(尽管我也在这里绘制了其他一些点。) -

(尽管我也在这里绘制了其他一些点。) -

现在,我想计算S and N 我知道的 X 射线板和 X 射线机器之间的距离是 180 厘米。

我已经尝试过使用该math功能。

distance = math.sqrt( ((N[0]-S[0])**2)+((N[1]-S[1])**2) )
print(distance)
Run Code Online (Sandbox Code Playgroud)

这给了我这样的结果 755.2747844327918

但我需要知道距离(以米为单位)。我怎样才能以某种方式做到这一点?

python math geometry image-processing computer-vision

-1
推荐指数
1
解决办法
480
查看次数