获取元素样式,CV检测的强制使用黑色细边框
(item)
| 1660 | all_elements_ref = [] |
| 1661 | |
| 1662 | def get_style_for_item(item): |
| 1663 | """获取元素样式,CV检测的强制使用黑色细边框""" |
| 1664 | style = extract_style_specific(image, item["bbox"], item["_type"]) |
| 1665 | if item.get("_source") == "cv": |
| 1666 | style["stroke_width"] = 1 |
| 1667 | style["stroke_color"] = "#000000" |
| 1668 | # 如果detect_rectangles_robust已经提取了填充色,优先使用 |
| 1669 | if item.get("fill_color"): |
| 1670 | style["fill_color"] = item["fill_color"] |
| 1671 | return style |
| 1672 | |
| 1673 | for item in containers_list: |
| 1674 | item["_style"] = get_style_for_item(item) |
no test coverage detected