I'm using openCv's warpAffine()
function to rotate an image with this code-
void rotateImage(const Mat &src, Mat &dest, double angle)
{
cv::Point2f point(src.cols/2, src.rows/2);
Mat rotationMatrix = cv::getRotationMatrix2D(point, angle, 1.0);
cv::warpAffine(src, dest, rotationMatrix, cv::Size(src.cols, src.rows));
}
It works fine if I rotate the image with some angle multiple of 90 (in degrees) but severly blurs the image with any arbitrary rotation angle.
eg- the original image
After rotating by 90 degree multiple times-
After rotating by 30 degree multiple times-
So is there any way I can rotate the image by any arbitrary angle and avoid the caused blur?