1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #12670 from alalek:imgproc_getRotationMatrix2D_return_type

This commit is contained in:
Alexander Alekhin
2019-09-28 18:03:33 +00:00
3 changed files with 18 additions and 15 deletions
+5 -11
View File
@@ -3234,7 +3234,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
}
cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
cv::Matx23d cv::getRotationMatrix2D_(Point2f center, double angle, double scale)
{
CV_INSTRUMENT_REGION();
@@ -3242,16 +3242,10 @@ cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
double alpha = std::cos(angle)*scale;
double beta = std::sin(angle)*scale;
Mat M(2, 3, CV_64F);
double* m = M.ptr<double>();
m[0] = alpha;
m[1] = beta;
m[2] = (1-alpha)*center.x - beta*center.y;
m[3] = -beta;
m[4] = alpha;
m[5] = beta*center.x + (1-alpha)*center.y;
Matx23d M(
alpha, beta, (1-alpha)*center.x - beta*center.y,
-beta, alpha, beta*center.x + (1-alpha)*center.y
);
return M;
}