|
|
@@ -58,7 +58,7 @@ def cal_pingban(result):
|
|
|
if float(result[index]["knee_right_angle"]) < 100 and float(result[index]["knee_left_angle"]) < 100:
|
|
|
is_prepared = True
|
|
|
# prepared posture: when knee at its lowest,number is highest
|
|
|
- first_index = "1"
|
|
|
+ first_index = list(result.keys())[0]
|
|
|
first_score = 0
|
|
|
if is_prepared:
|
|
|
lowest_knee = float(result_ig[list(result.keys())[0]]["knee_heigh"])
|
|
|
@@ -81,7 +81,7 @@ def cal_pingban(result):
|
|
|
re["1"]["is_prepared"] = False
|
|
|
# second posture
|
|
|
max_knee_angle = float(result_ig[list(result.keys())[0]]["hip_right_angle"])
|
|
|
- max_knee_angle_index = "1"
|
|
|
+ max_knee_angle_index = list(result.keys())[0]
|
|
|
second_pics = []
|
|
|
satisfied_index = []
|
|
|
for index in result:
|
|
|
@@ -92,9 +92,13 @@ def cal_pingban(result):
|
|
|
result_ig = is_zero(result_ig, index)
|
|
|
satisfied_index.append(index)
|
|
|
second_pics.append(result_ig[index])
|
|
|
- if float(result[index]["hip_right_angle"]) > float(max_knee_angle):
|
|
|
- max_knee_angle = result[index]["hip_right_angle"]
|
|
|
- max_knee_angle_index = index
|
|
|
+ if float(result[index]["hip_right_angle"]) > float(max_knee_angle):
|
|
|
+ max_knee_angle = result[index]["hip_right_angle"]
|
|
|
+ max_knee_angle_index = index
|
|
|
+ if len(satisfied_index) == 0:
|
|
|
+ result_ig = is_zero(result_ig, max_knee_angle_index)
|
|
|
+ satisfied_index.append(max_knee_angle_index)
|
|
|
+ second_pics.append(result_ig[max_knee_angle_index])
|
|
|
pingban_2_score = cal_second_score(second_pics)
|
|
|
total_score = pingban_2_score
|
|
|
if first_score != 0:
|