DetectionTeamUCAS / DetectionTeamUCAS/RRPN_Faster-RCNN_Tensorflow

remove cv2.convexHull get the same iou.

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
252
Forks
87
PR merge metrics
No merged PRs in 30d

Description

def intersection_area(rect1,rect2):
r1 = cv2.rotatedRectangleIntersection(rect1, rect2)
if r1[1] is None:
return 0
# order_points=cv2.convexHull(r1[1],returnPoints=True)
area = cv2.contourArea(r1[1])
return area
def intersection_area_convex(rect1,rect2):
r1 = cv2.rotatedRectangleIntersection(rect1, rect2)
if r1[1] is None:
return 0
order_points=cv2.convexHull(r1[1],returnPoints=True)
area = cv2.contourArea(order_points)
return area

and

for i in range(100):
x1,y1,w1,h1,angle1,x2,y2,w2,h2,angle2=np.random.randint(1,300,10)

result1=intersection_area( ((x1,y1),(w1,h1),angle1),((x2,y2),(w2,h2),angle2) )
result2=intersection_area_convex( ((x1,y1),(w1,h1),angle1),((x2,y2),(w2,h2),angle2) )
print(result1==result2)
always output true

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.