简体   繁体   English

要在多视图几何中最接近另一个 3D 点的线上找到 3D 点?

[英]To find 3D point on a line closest to another 3D point in Multi-view Geometry?

I have two stereo cameras and I captured the images of the markers both from left camera and the right cameras.我有两个立体相机,我从左相机和右相机中捕获了标记的图像。

I have a perfect calibration我有一个完美的校准

  1. Intrinsics内在函数
  2. Distortion Corrected失真校正
  3. Extrinsic外在

Now coming to the Markers, I have a set of markers on the board and I estimated the Pose of it.现在来到标记,我在黑板上有一组标记,我估计了它的姿势。 And also, I computed the 3D point of each marker based on Triangulate 3D points而且,我根据 Triangulate 3D 点计算了每个标记的 3D 点

cv::triangulatePoints(Projection_Matrix_L[o], Projection_Matrix_R[o], pointsMat1, pointsMat2, pnts3D);

Then I know the camera center(CL_O)然后我知道相机中心(CL_O)

CL_O = -Rotation_matrix.inv * translation

which is mostly (0,0,0)主要是 (0,0,0)

Similarly done for the other camera view.对其他相机视图也进行了类似的处理。 For simplicity let us just stick with one.为简单起见,让我们坚持使用一个。

I assume the below equation should calculate the points in the line based on lambda(λ)我假设下面的方程应该基于 lambda(λ) 计算直线中的点

line(λ) = CL_O + λ*t

CL_O, is a 3D point say (x0, y0, z0)
t, is a Vector (a, b, c)

With correct(λ) value, The result will be a 3D point say Q. But still its not close to Marker Point P. So I need to compute the minimum distance between Point P and Q.使用正确的(λ)值,结果将是一个 3D 点,比如 Q。但它仍然不接近标记点 P。所以我需要计算点 P 和 Q 之间的最小距离。

Questions - How should I determine λ for each 3D marker points, such that it gives me a 3Dpoint Q close to P with minimal error.问题 - 我应该如何确定每个 3D 标记点的 λ,以便它以最小的误差为我提供接近 P 的 3Dpoint Q。 I don't know if the below equation is correct?不知道下面的等式是否正确?

f(λ) = abs(Point P - line(λ))

If you think its correct, I need help with sample code/pseudo code to implement it (preferably C++ or python ).如果您认为它是正确的,我需要示例代码/伪代码的帮助来实现它(最好是 C++ 或 python )。

Even though I have written above, I still feel that something is still missing.虽然上面已经写了,但还是觉得还缺少点什么。 Please connect the dots and tell me how to proceed.请把点连起来,告诉我如何进行。

问题陈述图片

I had done a similar problem in java sometimes its algorithm can help you我在java中做过类似的问题,有时它的算法可以帮助你

Check out it at https://github.com/sreeragrnandan/JAVA-ASSIGNMENT/blob/master/Mdis.javahttps://github.com/sreeragrnandan/JAVA-ASSIGNMENT/blob/master/Mdis.java查看

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM