Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image 3D rotation OpenCV

I need to perform a 3D rotation of a 2D image on x and y axis. I read that i have to use the Homographic matrix on OpenCV , but i don't know how to set the matrix to perform a common rotation angle. For example 30 degree on x axis or 45° on y axis.

I read this post : Translating and Rotating an Image in 3D using OpenCV. I have tried different values of the f but it doesn't work.

I want to know which parameters of the matrix i have to change and how (formula). Thank you!

like image 758
Roberto Di Stefano Avatar asked Mar 22 '26 18:03

Roberto Di Stefano


1 Answers

Follow that same post, but replace your rotation matrix. Familiarize yourself with the Rorigues() function. You can send it a 1 x 3 array of the x, y, and z rotations. It will give you a a 3 x 3 rotation matrix. Plug this matrix in as the first 3 columns and 3 rows of R (leave the rest the same). If you don't want any translation, make sure you set the variable dist to 0 in the code on that page.

like image 163
Radford Parker Avatar answered Mar 25 '26 09:03

Radford Parker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!