You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defvalidate_clockwise_points(points):
""" Validates that the points that the 4 points that dlimite a polygon are in clockwise order. """# if len(points) != 8:# raise Exception("Points list not valid." + str(len(points)))# point = [# [int(points[0]) , int(points[1])],# [int(points[2]) , int(points[3])],# [int(points[4]) , int(points[5])],# [int(points[6]) , int(points[7])]# ]# edge = [# ( point[1][0] - point[0][0])*( point[1][1] + point[0][1]),# ( point[2][0] - point[1][0])*( point[2][1] + point[1][1]),# ( point[3][0] - point[2][0])*( point[3][1] + point[2][1]),# ( point[0][0] - point[3][0])*( point[0][1] + point[3][1])# ]# summatory = edge[0] + edge[1] + edge[2] + edge[3];# if summatory>0:# raise Exception("Points are not clockwise. The coordinates of bounding quadrilaterals have to be given in clockwise order. Regarding the correct interpretation of 'clockwise' remember that the image coordinate system used is the standard one, with the image origin at the upper left, the X axis extending to the right and Y axis extending downwards.")pts= [(points[j], points[j+1]) forjinrange(0,len(points),2)]
try:
pdet=Polygon(pts)
except:
assert(0), ('not a valid polygon', pts)
# The polygon should be valid.ifnotpdet.is_valid:
assert(0), ('polygon has intersection sides', pts)
pRing=LinearRing(pts)
ifpRing.is_ccw:
assert(0), ("Points are not clockwise. The coordinates of bounding quadrilaterals have to be given in clockwise order. Regarding the correct interpretation of 'clockwise' remember that the image coordinate system used is the standard one, with the image origin at the upper left, the X axis extending to the right and Y axis extending downwards.")
The commented code and the working code has opposite result for a same input.
I think the issue is shapely do the computation on Descartian coordinate system, and we use image pixel coordinate system which have opposite result?
Maybe the judgement should be simplely changed to if not pRing.is_ccw:
The text was updated successfully, but these errors were encountered:
AdelaiDet/adet/evaluation/rrc_evaluation_funcs.py
Line 298 in 5e19cb1
The commented code and the working code has opposite result for a same input.
I think the issue is shapely do the computation on Descartian coordinate system, and we use image pixel coordinate system which have opposite result?
Maybe the judgement should be simplely changed to
if not pRing.is_ccw:
The text was updated successfully, but these errors were encountered: