且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 C/C++ 中旋转图像

更新时间:2022-10-26 23:29:34

OpenCV2.0 has several computer vision and image processing tools. Specifically warpAffine (by defining the rotation matrix) will solve your problem with rotating an image.

The 2x3 transformation matrix mentioned in the documentation is as follows:

where θ is the angle of rotation and tx and ty is the translation along the x and y axes respectively.

You can get the source code here.

Also, OpenCV2.0 has many MATLAB-esque functions like imread, etc.