图像 3D 旋转 OpenCV [英] Image 3D rotation OpenCV

查看:85
本文介绍了图像 3D 旋转 OpenCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 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.

我读了这篇文章:翻译和旋转图像3D 使用 OpenCV.我尝试了不同的 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!

推荐答案

按照 same post,但替换你的旋转矩阵.熟悉 Rorigues() 函数.您可以向它发送一个 1 x 3 的 x、y 和 z 旋转数组.它会给你一个 3 x 3 的旋转矩阵.将此矩阵作为 R 的前 3 列和 3 行插入(其余保持不变).如果您不想进行任何翻译,请确保在该页面的代码中将变量 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆