geometry - Find the corners of a deformed rectangle -


I am trying to create a program that automatically corrects the rectangle perspective. I have been successful in getting the silhouette of the rectangle, and the code is there to improve the perspective, but I can not find corners. The biggest problem is that, because it has been distorted, I can not use the following "code":

  c1 = min (x), min (y) c2 = max X), minimum (y) C3 = minimum (x), maximum (y) c4 = maximum (x), max (y)  

this will not work with this condition (Angle represents the corner):

  X0000000000X 0.00000000000.00000000000 ..... 0000000 ....... 0000 ........... X  

Does anyone know this?

Give you one corner from the center, the corner from the first corner, Which will either be either adjacent or opposite. The line from the line between those two corners (a bit more intensitive intensitive) will give you a third corner, I was using distance from the center as a tie breaker. To find the fourth corner, this will be the point outside the triangle created by the first 3 corners you found, away from the nearest line between those corners.

It takes a lot of time to do this, and I have never tried to do it, but it should work.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -