Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I know you can calculate homographies from image to camera plane using correspondence points between a "perfect model" and the image points.

I'm doing it for a football pitch/field, and have used edge detection to find the white lines in the pitch.

But the camera does not (always) cover all of the pitch, so I can't see all the corners... and I only the corners are 100% known points in the model (no other distinguished points).

So the problem is that unless the line intersects with another line and forms a corner, I only know the image points of the line, not it's corresponding "perfect/real-world" coordinates in the model.

Is there some way I can use the detected lines to calculate a homography, or even just a set of candidate homographies, even if the detected lines do not intersect with each other and create a corner?

Example image, showing the pitch, our field of view, and the points of the pitch where I can know the corresponding realworld/model coordinates(green circles), and an example of 2 lines that might be completely useless since in our field of view, I have no clue exactly at which point they start or stop in the corresponding realworld /model of the pitch:

enter image description here The red lines are examples of lines which I would like to use, but I don't know their realworld coordinates, and it's kind of hard to estimate them because depending on the camera pose, the correspondent points could be "anywhere".

share|improve this question
Do you have some example images? Or at least a sketch of possible cases for line detection? I think the short answer to your question is "yes, you can", but more details from you would help to give more detailed answer :) –  penelope Nov 28 '12 at 9:32
Can you provide an example image? Are you saying that the detected line segments don't intersect or have you tried extending the detected segments to lines and then tried finding intersections? –  ppalasek Nov 28 '12 at 9:33
I added an example image to the question –  Henrik Kjus Alstad Nov 28 '12 at 11:35

1 Answer 1

One approach would require a line matching algorithm. After matching the lines, you could simply use the end points of the lines in order. To achieve that EDLine or LSD based descriptors are recently proposed in OpenCV. Also, hashing and fast matching of them are also implemented. Check out the videos here:

http://www.youtube.com/watch?v=MqMjvSkM39k http://www.youtube.com/watch?v=naSWTlbg3To

The recent opencv_contrib repository contains the source code to these methods.

In the case that the line end points are noisy, you could then directly utilize the lines to compute the homographies. Such papers would then read:

Internal Report: 2005-V04 Computing Homographies from Three Lines or Points in an Image Pair G. Lopez-Nicolas, J.J. Guerrero, O.A. Pellejero, C. Sagues

Internal Report: 2003-V01 Robust line matching and estimate of homographies simultaneously G. Lopez-Nicolas

Probabilistic Matching of Lines for Their Homography Taemin Kim, Jihwan Woo, and In So Kweon

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.