简体   繁体   English

使用基本矩阵使用 OpenCV 计算坐标平移

[英]Use fundamental matrix to compute coordinates translation using OpenCV

I am trying to compute the coordinates correspondence of several points between two images.我正在尝试计算两个图像之间几个点的坐标对应关系。 I have a group of points whose correspondences are known, I use them with OpenCV's findFundamentalMatrix() in order to find the fundamental matrix.我有一组点的对应关系是已知的,我将它们与 OpenCV 的findFundamentalMatrix()一起使用以找到基本矩阵。 I verified that x^T * F * x' = (0) for each point, and the result is always right or very close.我验证了每个点的x^T * F * x' = (0) ,结果总是正确或非常接近。

The thing is, now I'd like to use the coordinates of a point on the first image ( y ) and the fundamental matrix ( F ) in order to find the coordinates of the point on the second image ( y' ).问题是,现在我想使用第一个图像 ( y ) 上一个点的坐标和基本矩阵 ( F ) 来找到第二个图像 ( y' ) 上该点的坐标。 I first thought about simply using the equation above, but given only the z of the y' point, there can be an infinity of solutions .我首先想到的是简单地使用上面的等式,但仅给定y'点的z ,可以有无穷多个解

How else can I use the fundamental matrix to compute the translations ?我还能如何使用基本矩阵来计算翻译?

To be more clear: knowing the fundamental matrix "linking" two projections, how can I use it to translate the coordinates of any known point (a, b, 1) from the first projection to the second projection?更清楚地说:知道“链接”两个投影的基本矩阵,我如何使用它来将任何已知点(a, b, 1)的坐标从第一个投影转换为第二个投影?

Considering that we know a , b and F in this equation: (a', b", 1) T * F * (a, b, 1) = (0)考虑到我们在这个等式中知道a , bF : (a', b", 1) T * F * (a, b, 1) = (0)

I had made a simple drawing as an example: http://i.imgur.com/drNr2.jpg .我做了一个简单的绘图作为例子: http : //i.imgur.com/drNr2.jpg The idea is to find the coordinates of the red dot (xq, yq) in projection 2, considering that we know its coordinates in projection 1 and the ones of all other points in both projections (and some other ones as the algorithm to find the fundamental matrix actually requires at least 8 points)这个想法是在投影 2 中找到红点(xq, yq)的坐标,考虑到我们知道它在投影 1 中的坐标以及两个投影中所有其他点的坐标(以及其他一些作为找到基本矩阵实际上至少需要8个点)

Another precision: in my example, known points are coplanar, but the researched point will not necessarily be.另一个精度:在我的例子中,已知点是共面的,但研究点不一定是共面的。

I hope that made my problem more clear :)我希望这让我的问题更清楚:)

The fundamental matrix transforms points from one image to lines in the other.基本矩阵将一个图像中的点转换为另一图像中的线。 Could you elaborate more on你能详细说明一下吗

How else can I use the fundamental matrix to compute the translations?我还能如何使用基本矩阵来计算翻译?

please.请。 Telling us what you want to achieve perhaps with an example would help too.用一个例子告诉我们你想要实现的目标也会有所帮助。

Edit : If you have calibrated the camera you can compute the essential matrix, E , from the fundamental matrix, F .编辑:如果您已经校准了相机,您可以从基本矩阵F计算基本矩阵E E transforms a point in one image to a point in the other. E 将一个图像中的一个点转换为另一个图像中的一个点。 But of course, the requirement is to have the internal matrix.但当然,要求是有内部矩阵。 If K is the internal matrix E=transpose(K)FK .如果K是内部矩阵E=transpose(K)FK The other method is to find the corresponding line for a point in the other image and then search along this line for the patch most similar in appearance to the patch surrounding the point in the first image.另一种方法是在另一幅图像中找到一个点的对应线,然后沿着这条线搜索与第一个图像中点周围的块在外观上最相似的块。 There are some other ways too but really need more information about the problem to tell which suits your case.还有一些其他方法,但确实需要有关问题的更多信息才能确定哪种方法适合您的情况。

Edit 2 : in the drawing you have got the points are coplanar.编辑 2 :在绘图中你得到的点是共面的。 Hence, a homography maps the point positions between the two images, and there is no need to find the fundamental matrix.因此,单应映射两个图像之间的点位置,并且不需要找到基本矩阵。 OpenCV has a function for estimating homographies, which needs only four points. OpenCV有一个估计单应性的功能,只需要四个点。

Given:鉴于:

Point correspondences a in image 1.图 1 中的点对应a

Goal:目标:

Finding corresponding points b laying on the so called epipolar line L in image 2.找到位于图像 2 中所谓的极线L上的对应点b

How?如何?

    | x0 |       | x1 |
a = | y0 | , b = | y1 |
    | 1  |       | 1  |

L = F * a

    |F00 F01 F02|
F = |F10 F11 F12|
    |F20 F21 F22|

The following equation must be fulfilled to obtain b in image 2:必须满足以下等式才能获得图像 2 中的b

a' * F * b = 0 . a' * F * b = 0

Note: a' = transpose(a) .注意: a' = transpose(a)

For some reason I could not add a comment due to a lack of reputation.出于某种原因,由于缺乏声誉,我无法添加评论。 I have been studying this field for about a month now and hopefully I can answer the many questions left unanswered that have also puzzled me when I was studying the topic.我已经研究了这个领域大约一个月了,希望我能回答很多悬而未决的问题,这些问题在我研究这个主题时也让我感到困惑。

@M2X A fundamental matrix is a mapping from a point in image plane 1 to a line in image plane 2. The lines are a special type of lines called epipolar lines and are formed by the intersection of the image plane and the plane constructed from the origin of the 2 cameras and the 3D point. @M2X 基本矩阵是从图像平面 1 中的点到图像平面 2 中的线的映射。这些线是一种特殊类型的线,称为极线,由图像平面与由2 个摄像机的原点和 3D 点。 So it is not possible to determine a point-point mapping using the Fundamental matrix unless you have some additional information or constraints.因此,除非您有一些附加信息或约束,否则无法使用基本矩阵确定点-点映射。

@Jukurrpa A homography is a point to point mapping such that parallel lines map to parallel lines. @Jukurrpa 单应性是点对点映射,使得平行线映射到平行线。 One can prove that this mapping is linear, then since linear maps a equivalent to matrices, the homography can be defined by a matrix.可以证明这种映射是线性的,那么由于线性映射等效于矩阵,单应性可以由矩阵定义。 A set of 3D points lying on a plane projected to the image plane maps parallel lines to parallel lines, so a homography will work in your case.位于投影到图像平面的平面上的一组 3D 点将平行线映射到平行线,因此单应性适用于您的情况。 Methods of estimating homograph from a given set of points is outlined in the book (multiple view geometry in computer vision).书中概述了从给定的一组点估计同形异义词的方法(计算机视觉中的多视图几何)。 Given corresponding points in both images you can find homography by using iterative approaches (Gradient Descent) or closed form solutions (Singular Value Decomposition).给定两个图像中的对应点,您可以使用迭代方法(梯度下降)或封闭形式解决方案(奇异值分解)找到单应性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在OpenCV中使用旋转和平移矩阵 - Using Rotation and Translation Matrix in OpenCV 如何使用OpenCV计算2帧之间的旋转平移矩阵 - How to compute rotation-translation matrix between 2 frames with OpenCV 使用OpenCV通过Python和C ++计算基本矩阵的结果不同 - Different result in computing fundamental matrix by Python and C++ using OpenCV 从基本矩阵中提取翻译和轮换 - Extract Translation and Rotation from Fundamental Matrix 使用OpenCV进行摄像机校准:使用失真和旋转平移矩阵 - Camera Calibration with OpenCV: Using the distortion and rotation-translation matrix 我们如何计算在opencv中使用的两个立体声摄像机的旋转和平移StereoRectify(r,t参数) - How can we compute rotation and translation two stereo cameras to use in opencv StereoRectify(r,t argument) 如果我知道3D中的齐次变换矩阵,如何使用opencv查找旋转和平移角度? - How to find the angle of rotation and translation using opencv if I know the homogeneous transformation matrix in 3d? OpenCV C ++。 快速计算混淆矩阵 - OpenCV C++. Quickly compute confusion matrix 在OpenCV C ++中估计基本矩阵之前对相应点进行归一化的正确方法是什么? - What is the correct way to Normalize corresponding points before estimation of Fundamental matrix in OpenCV C++? 3D重建C ++与OpenCV..Fundamental Matrix太大了 - 3D reconstruction C++ with OpenCV..Fundamental Matrix too large
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM