1 | initial version |
First you have to create the 2x3 rotation matrix.
cv::Point2f center(((float)imageSize.width * 0.5f), ((float)imageSize.height * 0.5f)); cv::mat RotMap = cv::getRotationMatrix2D( center, Rot, 1.0);
then rotate your image
cv::warpAffine(ImageMatIn, RotatedImageMatOut, RotMap, CameraAvgImage.size(), cv::INTER_LINEAR, cv::BORDER_REPLICATE , cv::Scalar(127,127,127));