优化图片分割和拓展方法,兼容横向过长的图片

This commit is contained in:
2024-08-08 14:15:51 +08:00
parent dd8dcc0d3c
commit d296fa4414
3 changed files with 50 additions and 43 deletions

View File

@@ -56,7 +56,7 @@ def visual_model_test(model_type, test_img, task_path, schema):
# angle = image_util.parse_rotation_angles(img["img"])[0]
angle = 0
rotated_img = image_util.rotate(img["img"], angle)
rotated_img, offset_x, offset_y = image_util.expand_to_a4_size(rotated_img, True)
rotated_img, offset_x, offset_y = image_util.expand_to_a4_size(rotated_img)
cv2.imwrite(temp_file.name, rotated_img)
img["x_offset"] -= offset_x