Rotating an image in C/C++

后端 未结 5 978
傲寒
傲寒 2020-12-18 05:49

I need code for rotating an image in C++ which functions like imrotate function of matlab. Please suggest a good link. Or if someone can provide the code for imrotate.

相关标签:
5条回答
  • 2020-12-18 06:03

    Check this hope it helps .

    Other questions on stack overflow on the same topic experts opinion on it.

    0 讨论(0)
  • 2020-12-18 06:05

    libgd has image rotation functions.

    0 讨论(0)
  • 2020-12-18 06:06

    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: alt text

    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.

    0 讨论(0)
  • 2020-12-18 06:07

    Magick can help you. Read this PDF and search for rotate.

    0 讨论(0)
  • 2020-12-18 06:17

    There is no built-in way of accomplishing this in C++, short of writing your own function for manipulating binary data, which yields other problems like "How do I decompress a jpg/png in C++?"

    Your best bet is a 3rd party graphics library such as libSDL

    0 讨论(0)
提交回复
热议问题