1 | initial version |
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:
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.