【发布时间】:2014-01-20 15:09:05
【问题描述】:
我在 OpenCV 中使用warpAffine 来旋转一个矩形。现在我想得到这个旋转矩形的四个顶点(四个点的 x 和 y 位置)而不将它旋转回来。经过几个小时的搜索,我没有找到任何结果。有人可以帮我吗?谢谢你。
【问题讨论】:
标签: c++ opencv rotation rectangles image-rotation
我在 OpenCV 中使用warpAffine 来旋转一个矩形。现在我想得到这个旋转矩形的四个顶点(四个点的 x 和 y 位置)而不将它旋转回来。经过几个小时的搜索,我没有找到任何结果。有人可以帮我吗?谢谢你。
【问题讨论】:
标签: c++ opencv rotation rectangles image-rotation
像这样:
cv::RotatedRect RotRect;
// Fill in RotRect somehow...
//Get four corners
cv::Point2f pts[4];
RotRect.points(pts);
documentation 也有一个例子。
【讨论】: