从两个Kinect深度图中提取投影单应性 [英] Extract projective homography from two Kinect depth maps
问题描述
考虑到从Kinect深度图获得的两个连续的3D点云1和2(不是整个云,比如说用OpenCV的GoodFeaturesToMatch从云中选择了100个点),我想从1到2计算摄像机的单应性.这是一种投影变换,许多人已经完成了:此处(幻灯片12),此处(幻灯片30)和这里似乎是经典论文 .我的问题是,尽管我是一名合格的程序员,但我还没有数学或触发技能将这些方法之一转换为代码.由于这不是一个容易解决的问题,因此我为解决以下问题的代码提供了丰厚的回报:
Given two consecutive 3D point clouds 1 and 2 (not the whole cloud, say 100 points selected from the cloud with OpenCV's GoodFeaturesToMatch), obtained from a Kinect depthmap, I want to compute camera's homography from 1 to 2. I understand that this a projective transform, and it has already been done by many people: here (slide 12), here (slide 30) and here in what seems to be the classic paper. My problem is that whilst I'm a competent programmer, I haven't got the math or trig skills to turn one of those methods into code. As this is not an easy problem, I offer a large bounty for the code that solves the following problem:
相机位于Z方向的原点,位于不规则的五面体[A,B,C,D,E,F]:
The camera is at the origin, looking in the Z direction, at irregular pentahedron [A,B,C,D,E,F]:
摄像机向左(X)移动-90mm,向(Y)向上+ 60mm,向前(Z)+ 50mm,向下旋转5°,向右旋转10°,并逆时针旋转-3°:
The camera moves -90mm to the left (X), +60mm up (Y), +50mm forwards (Z) and rotates 5° down, 10° right and -3° anticlockwise:
旋转整个场景,以使摄影机返回其原始位置,这使我可以确定顶点在2处的位置:
Rotating the entire scene so that the camera is back at its original position allow me to determine the vertices' locations at 2:
The 3DS Max files used to prepare this are max 1, max 2 and max 3
以下是顶点在顶点之前和之后的位置,内在函数等:
Here are the vertices' positions before and after, the intrinsics, etc.:
请注意,camera2的顶点不是100%准确的,有一点故意的噪声.
Note that camera2's vertices are not 100% accurate, there's a bit of deliberate noise.
我需要的代码(必须在需要时使用EMGUCV和OpenCV轻松转换为VB.Net或C#),将获取两组顶点和内在函数并生成以下输出:
The code I need, which must be readily translatable into VB.Net or C#, using EMGUCV and OpenCV where necessary, takes the 2 sets of vertices and the intrinsics and produces this output:
Camera 2 is at -90 X, +60 Y, +50 Z rotated -5 Y, 10 X, -3 Z.
The homography matrix to translate points in A to B is:
a1, a2, a3
b1, b2, b3
c1, c2, c3
我不知道同构坐标的单应性是3X3还是3X4,但是必须允许我将顶点从1转换为2.
I don't know if the homography is 3X3 or 3X4 for homogenous coordinates, but it must allow me to translate the vertices from 1 to 2.
我也不知道a1,a2等值;那就是您必须找到的>;-)
I also don't know the values a1, a2, etc; that's what you have to find >;-)
这500个悬赏项目替代"了我对这个非常相似的问题提供的悬赏,我ve在那里添加了指向该问题的评论.
The 500 bounty offer 'replaces' the bounty I offered to this very similar question, I've added a comment there pointing to this question.
我想知道我问这个问题的方式是否具有误导性.在我看来,问题不仅仅在于点云拟合,还在于相机的几何形状(如果您知道如何将A转换为B并将其旋转到B,则可以知道相机的变换,反之亦然).如果是这样,那么也许可以使用Kabsch的算法或类似的方法来获得解决方案
推荐答案
用于计算2D或3D点云的两个快照之间的差异的正确"算法称为ICP(
"The correct" algorithm to use for computing difference between two snapshots of 2D or 3D point clouds is called ICP (Iterative Closest Point). The algorithm solves
以人类可读的格式:对于给定的点集P1和P2,找到将P1转换为P2的旋转矩阵R和平移T.只要确保它们在原点周围都已标准化即可.
In human-readable-format: For given point sets P1 and P2 find the rotation matrix R and translation T that transforms P1 to P2. Just make sure they are normalized around their origin.
该算法在概念上很简单,并且经常实时使用.它会反复修改所需的转换(平移,旋转),以最大程度地减少两次原始扫描的点之间的距离.
The algorithm is conceptually simple and is commonly used in real-time. It iteratively revises the transformation (translation, rotation) needed to minimize the distance between the points of two raw scans.
对于那些感兴趣的人,这是计算几何处理中的一个主题
For those interested this is a topic within Computational Geometry Processing
这篇关于从两个Kinect深度图中提取投影单应性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!