@@ -424,7 +424,7 @@ def get_center_coordinate(self, coor):
424
424
def is_inside (self , small_item_center_coor , big_item_coor ):
425
425
[big_x_min , big_y_min , big_x_max , big_y_max ] = big_item_coor
426
426
[small_center_x , small_center_y ] = small_item_center_coor
427
- if small_center_x >= big_x_min and small_center_x <= big_x_max and small_center_y > big_y_min and small_center_y < big_y_max :
427
+ if big_x_min <= small_center_x <= big_x_max and big_y_min < small_center_y < big_y_max :
428
428
return True
429
429
else :
430
430
return False
@@ -574,12 +574,15 @@ def evaluate_rider_tweezers(self):
574
574
elif np .linalg .norm (rider_min_coordinate - tweezers_min_coordinate ) > self .use_tweezers_threshold :
575
575
self .scoring ['measuring_score_rider_tweezers' ] = 0
576
576
self .keyframe ['measuring_score_rider_tweezers' ] = self .frame_counter
577
- self .rider_tweezers_lock_mark = True # once detected not using tweezers, will lose mark and not able to gain back this mark again
578
- # corner case: rider and tweezer can't found correctly at the same time. we only detect tweezer_coor whether under balance
577
+ # once detected not using tweezers, will lose mark and not able to gain back this mark again
578
+ self .rider_tweezers_lock_mark = True
579
+ # corner case: rider and tweezer can't found correctly at the same time.
580
+ # we only detect tweezer_coor whether under balance
579
581
elif len (tweezers_coor ) == 1 and len (self .side_object_dict ['balance' ]) == 1 :
580
582
tweezers_coor = self .side_object_dict ['tweezers' ][0 ]
581
583
balance_coor = self .side_object_dict ['balance' ][0 ]
582
- if self .is_behind (tweezers_coor , balance_coor ):
584
+ if self .is_behind (tweezers_coor , balance_coor ) and self .is_inside (self .get_center_coordinate (tweezers_coor ),
585
+ balance_coor ):
583
586
self .scoring ['measuring_score_rider_tweezers' ] = 1
584
587
self .keyframe ['measuring_score_rider_tweezers' ] = self .frame_counter
585
588
0 commit comments