将"Cartesian coordinates"转换为"polar coordinates with respect to user specified origin"

Convert "Cartesian coordinates" to "polar coordinates with respect to user specified origin"

本文关键字:coordinates to user specified respect origin polar Cartesian 转换 with      更新时间:2023-10-16

我正在尝试将图像中的几个点转换为OpenCV中的极坐标。我遇到了一个叫做cartToPolar的函数,它会给我点的极坐标,0是我的原点。然而,我想通过将图像中的另一点视为原点来进行转换。有人能帮我这么做吗?我看到一些帖子说重新映射有助于改变原点,但我不清楚它是如何工作的。

然后您必须将参考点移动到原点:

px -= ref.x;  
py -= ref.y;

现在将(px,py)传递给cartToPolar函数