Ask Your Question

Revision history [back]

Answering myself...

I tried what I described above. I used the 2D lines as 3D point (an Nx3 matrix) and got back a 6-element vector [P,D]. I used this to create 3D points, P and Q=P+D, which I then normalized by the 3rd coordinate to get 2 2D homographic points. I found the parametric line L through P and Q, and after normalizing L by its 3rd coordinate I got the desired intersection point.

A few notes:

  1. Using CV_DIST_L2 with cv::fitLine does not give exactly the same results as using the SVD solver to find the least-square null-space of the matrix.
    In fact, in certain cases I got #INF where the SVD worked without a problem.
  2. I did not see a lot of differences between the different M-estimator methods, except when sometimes some would give a completely wrong result.