Search code examples
opencvcomputer-visionlineperspectivehomography

Condition of lines that are results of perspective transform


I have set of lines that have been transformed using a perspective transformation. The information that I know about these lines are:

  • They are lines not line segments (no length or start point or end point is known)
  • They are all parallel
  • Distances between them are unknown and vary from pair to pair.

Imaginary image of origin and result

So, to make it clear again, I do not know the blue lines. I have just the greens. Even, I do not know what is the Homograph Matrix that was applied.

Question: I need a method, a measurement, an algorithm or even a hint about the condition that must all the green lines satisfied.

For example if I add this red line to the set: Noisy line added

It is obvious that the red line could not be exist in the set of lines before applying the transformation so it is a noise of course. So I need a measurement if I applied it on the green lines would give me positive response and if add the red line to the green set it would show a negative response or at least a lower confidence.

P.S. OpenCV is available and preferred.


Solution

  • If they are parallel before perspective projection all lines should intersect in the same vanishing point. I would say you should compute this point using your green lines (maybe this is helpful) and if the distance from your red line to the vanishing point is to big it can be rejected.