Finding Homography Matrix Using Lines

I have some Points and Lines from original image and the corresponding points and lines from top view image.

-> I tried to find homography using points

1. Used OpenCV function findHomography(objectPointsPlanar, imagePoints) :

• It takes 4 points from original image and 4 points from top view image(required image) and it returns homography matrix of 3x3.
2. Used mathematical formula to find homography matrix (Didn't use any library) :

PS : I used the determined homography matrix to warp the image, but I am not happy with the output. It doesn't come to be accurate. So I am thinking to use lines to find homography matrix.

-> Homography determination using Lines :

• I tried to look for any library which can find homography matrix using lines, but I didn't get.
• I also looked at research papers to get the mathematical formula to find the homography matrix, but was not able to understand the formula.
• I am sharing the link of a research paper : A new normalized method on line-based homography estimation

• I'm not sure I understand what you're after.
– Royi
Aug 31 '19 at 6:49
• I want to find homography using lines. How to find homography using lines ? Sep 2 '19 at 4:58
• Have you developed what is the general closed form transformation for a line?
– Royi
Sep 2 '19 at 5:05
• Do you mean line equations ? Sep 2 '19 at 5:11
• I have got the line equations for some 4-5 lines. Sep 2 '19 at 5:12