Wednesday, November 30, 2022

Translation and Rotation of Images in Six Degree of Freedom Using OpenCV

I would like to share a small C++ function to translate and rotate images in 3D space in six degree of freedom (6 DoF). It also adjusts brightness and contrast. I use OpenCV library to perform some image processing.



OpenCV Setup on Linux

Since the program uses OpenCV, if it is not already setup on your machine, you can run the following command on a Debian based Linux machine to install it.
$ sudo apt update && apt install libopencv-dev



C++ Example for 6 DoF Image Rotation

The program can be found at the following link.

https://github.com/yan9a/cecv/blob/master/imrotate6dof/imRotate6DoF.cpp

The image used in the program is available at:

https://github.com/yan9a/cecv/blob/master/DisplayImage/thiri.jpg

The output of the program is shown below.


Figure . Rotated output image.




No comments:

Post a Comment

Comments are moderated and don't be surprised if your comment does not appear promptly.