@staticmethod
def rec_image_center(img_path: str) -> list:
"""
识别图片并返回文字的中心点位置
:param img_path:
:return:
"""
# 识别图片
c_list = LogicOcr.rec_image_origin(img_path)
# 计算中心点位置
for item in c_list:
# 获取四个点的坐标
points: list = item[0]
# 计算所有点的平均x和y坐标
x_sum = sum([p[0] for p in points])
y_sum = sum([p[1] for p in points])
# 计算中心点的坐标
center_x = x_sum / len(points)
center_y = y_sum / len(points)
item.append((center_x, center_y))
return c_list