我在多个视角下拍摄了建筑物正面的图像。然后我使用bundler来重建建筑物的3D点云。然后我使用 RANSAC 方法在点云中查找立面的平面。
这为我提供了平面及其表面法线的参数。
从捆绑器中,我还获得了相机旋转矩阵,我用它来计算相机的观看方向。
现在考虑到我有平面的法线和相机的观看方向,我想用它来校正图像,即好像相机的观看方向拍摄的图像与平面的法线相同。
如何从这两个向量计算投影变换矩阵?
I have taken images of the facade of a building under multiple view points. Then I use bundler to reconstruct the 3D point cloud of the building. Then I use a RANSAC method to find the plane of the facade in the point cloud.
This gives me the parameters for the plane and its surface normal.
From bundler I also get the camera rotation matrices, which I use to calculate the viewing directions of the cameras.
Now given that I have the normal of the plane and the camera viewing directions, I would like to use this to rectify the images, i.e. as if the images where taken with the camera's viewing direction being the same as the normal of the plane.
How can I calculate the projective transformation matrix from these two vectors?
发布评论
评论(1)
通过旋转可以使平面法线n与相机的光轴o对齐。通过取 -n 和 o 的叉积可以找到该旋转的轴,并根据这些向量之间的角度计算旋转量(使用点积)。此信息足以构建 3x3 旋转矩阵,然后您可以使用该矩阵来扭曲图像。
您可能会发现以下文章非常有用,因为它更详细。它还提出了一些简化,将计算减少到仅对平面法线分量进行一些基本算术运算。
长度和角度的限制
KI Kanatani - 计算机视觉、图形和图像处理,1988 - Elsevier
http://www.iim.cs.tut.ac.jp/~kanatani/papers/cvgip41-88.pdf
The plane normal n can be brought in line with the camera's optical axis o with a rotation. The axis of this rotation is found by taking the cross product of -n and o and the amount to rotate is computed from the angle between these vectors (use dot product). This information is sufficient to build up a 3x3 rotation matrix that you can then use to warp the image.
You may find the following paper very useful as it goes into further detail. It also presents some simplifications that reduce the computation to just a few basic arithmetic operations on the components of the plane normal.
Constraints on length and angle
KI Kanatani - Computer Vision, Graphics, and Image Processing, 1988 - Elsevier
http://www.iim.cs.tut.ac.jp/~kanatani/papers/cvgip41-88.pdf