The planar three-line junction perspective problem with application to the recognition of polygonal patterns