opencv 3.3.0 如何旋转图像?

函数介绍

1. void cv::flip(InputArray src,OutputArray dst,int flipCode)
2. void cv::transpose(InputArray src,OutputArray dst)
0: 沿X轴翻转; >0: 沿Y轴翻转; <0: 沿X轴和Y轴翻转
flip(frame, frame, 0);
flip(frame, frame, -1);
flip(frame, frame, 1);

1. 顺时针旋转 90 度

Mat frame;
cv::transpose(frame,frame);
flip(frame, frame, 1);

2. 旋转 180 度

Mat frame;
flip(frame, frame, -1);

3. 旋转 270 度(逆时针旋转 90 度)

Mat frame;
cv::transpose(frame,frame);
flip(frame, frame, 0);
原文地址:https://www.cnblogs.com/cheungxiongwei/p/7563079.html