gpt4 book ai didi

python - 图像调整大小后查找点的新坐标

转载 作者:太空宇宙 更新时间:2023-11-03 12:23:07 25 4
gpt4 key购买 nike

我已将我的图像调整为 newX, newY。在调整大小之前,我有一个点 (x,y)。现在我已经调整了图像大小,我想知道新图像上的点在哪里。听起来很简单,但我数学不好。有任何想法吗?

最佳答案

这只是一个比例问题:

在 x 轴上,您已按比例 Rx = newX/oldX 调整大小,在 y 轴上按比例 Ry = newY/oldY 调整大小。

因此,点 (x,y) 的新坐标是 (Rx * x, Ry * y)

关于python - 图像调整大小后查找点的新坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45724955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com