1. 读取图片:
cv::Mat tmpImage = cv::imread(“imgPath”);
2. 逆时针旋转90度,保存:
transpose(tmpImage, tmpImage);
flip(tmpImage, tmpImage, 0);
cv::imwrite(imgFullPath, tmpImage);
3. 顺时针旋转90度,保存:
transpose(tmpImage, tmpImage);
flip(tmpImage, tmpImage, 1);
cv::imwrite(imgFullPath, tmpImage);