【问题标题】:How to get vertices of a rotated rectangle in OpenCV?如何在 OpenCV 中获取旋转矩形的顶点?
【发布时间】:2014-01-20 15:09:05
【问题描述】:

我在 OpenCV 中使用warpAffine 来旋转一个矩形。现在我想得到这个旋转矩形的四个顶点(四个点的 x 和 y 位置)而不将它旋转回来。经过几个小时的搜索,我没有找到任何结果。有人可以帮我吗?谢谢你。

【问题讨论】:

    标签: c++ opencv rotation rectangles image-rotation


    【解决方案1】:

    像这样:

    cv::RotatedRect RotRect;
    // Fill in RotRect somehow...
    
    //Get four corners
    cv::Point2f pts[4];
    RotRect.points(pts);
    

    documentation 也有一个例子。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多