且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 OpenCV 将图像旋转 90 度的最简单方法?

更新时间:2023-11-28 21:24:10

从 OpenCV3.2 开始,生活变得更简单了,您现在可以在一行代码中旋转图像:

As of OpenCV3.2, life just got a bit easier, you can now rotate an image in a single line of code:

cv::rotate(image, image, cv::ROTATE_90_CLOCKWISE);

对于方向,您可以选择以下任何一项:

For the direction you can choose any of the following:

ROTATE_90_CLOCKWISE
ROTATE_180
ROTATE_90_COUNTERCLOCKWISE