添加涂抹关键词自定义偏移量功能

This commit is contained in:
2024-07-26 14:12:43 +08:00
parent 22fa38525f
commit 1dcb4aadd2
2 changed files with 6 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ def get_mask_layout(image, name, id_card_num):
match_list = re.findall(key["key"], layout[1])
for m in match_list:
if m in layout[1]:
boxes += find_boxes(m, layout, offset=len(m), length=key["length"])
boxes += find_boxes(m, layout, offset=key.get("offset", len(m)), length=key["length"])
if match_list:
break
return boxes