This commit is contained in:
HuangHai
2026-01-13 11:55:08 +08:00
parent a6f942f6e6
commit c36ab00318
7 changed files with 352 additions and 494 deletions

View File

@@ -399,6 +399,12 @@ def crop_cards_from_image(img_path, output_dir=None, save_debug=True):
json_data["cards"].append({
"id": idx + 1,
"rect": [int(x1), int(y1), int(x2), int(y2)],
"bounds_norm": {
"left": round(float(x1) / w, 4),
"top": round(float(y1) / h, 4),
"right": round(float(x2) / w, 4),
"bottom": round(float(y2) / h, 4)
},
"click_point": [int(click_x), int(click_y)]
})