Line segment detection in forms processing problems