【问题标题】:How to rotate coordinates taking into account that OpenCV adds black borders to the image when rotating with WarpAffine?考虑到 OpenCV 在使用 WarpAffine 旋转时为图像添加黑色边框,如何旋转坐标?
【发布时间】:2019-07-11 09:44:10
【问题描述】:

我有这张图片:

我有白色圆圈中心的坐标。我还有这张图片:

,它们是相同的图像,但第二个使用 OpenCV 的 WarpAffine 旋转了 4°。我要做的是计算4°图像中白色圆圈的中心坐标,同时考虑到OpenCV的WarpAffine在旋转时会给图像添加黑色边框。

【问题讨论】:

    标签: python opencv rotation computer-vision coordinates


    【解决方案1】:

    您可以在 WarpAffine 的变换矩阵上乘以圆的坐标:(x* y* 1) = TrMat * (x y 1)T

    理论is here。在 Python 中:numpy.dot

    【讨论】:

      猜你喜欢
      • 2020-11-23
      • 1970-01-01
      • 2013-05-18
      • 1970-01-01
      • 2011-12-10
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多