Quadrilateral detection