我需要在x和y轴上执行2D图像的3D旋转。 我读到我必须在OpenCV上使用Homographic矩阵,但我不知道如何设置矩阵来执行常见的旋转角度。例如x轴上30度或y轴上45°。
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.
我读过这篇文章:使用OpenCV在3D中翻译和旋转图像。我尝试了f的不同值,但它不起作用。
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!
推荐答案关注相同的帖子,但替换你的旋转矩阵。熟悉 Rorigues()函数。您可以向它发送x,y和z旋转的1 x 3阵列。它会给你一个3 x 3的旋转矩阵。将此矩阵作为前3列和3行R插入(其余部分保持不变)。如果您不想要任何翻译,请确保在该页面的代码中将变量dist设置为0.
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.
更多推荐
图像3D旋转OpenCV
发布评论