What is the best way (in c/c++) to rotate an IplImage/cv::Mat by 90 degrees? I would assume that there must be something better than transforming it using a matrix, but I ca
Here is my python cv2 implementation:
cv2
import cv2 img=cv2.imread("path_to_image.jpg") # rotate ccw out=cv2.transpose(img) out=cv2.flip(out,flipCode=0) # rotate cw out=cv2.transpose(img) out=cv2.flip(out,flipCode=1) cv2.imwrite("rotated.jpg", out)