forked from lizilaywer/PrivacyGuard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.json.template
More file actions
106 lines (106 loc) · 3.33 KB
/
Copy pathconfig.json.template
File metadata and controls
106 lines (106 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
"_comment": "PrivacyGuard 配置文件模板 - 复制为 config.json 后修改",
"version": "1.0",
"app": {
"name": "PrivacyGuard 脱敏卫士",
"window": {
"default_width": 1300,
"default_height": 900,
"min_width": 900,
"min_height": 600,
"dialog_settings_width": 550,
"dialog_settings_height": 700,
"dialog_image_list_width": 600,
"dialog_image_list_height": 500,
"dialog_feedback_width": 480,
"dialog_feedback_height": 600
},
"feedback_url": "https://fcnwakmkeuz7.feishu.cn/share/base/form/shrcnEM1JEbdIKzdB400egj9lHe"
},
"redaction": {
"default_rules": {
"身份证号": {
"pattern": "(?<!\\d)([1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]|\\d{15})(?!\\d)",
"enabled": true,
"description": "匹配15位或18位身份证号码"
},
"手机号码": {
"pattern": "(?<!\\d)(1[3-9]\\d{9})(?!\\d)",
"enabled": true,
"description": "匹配中国大陆手机号码"
},
"日期时间": {
"pattern": "\\d{4}[年\\-\\.]\\d{1,2}[月\\-\\.]\\d{1,2}[日]?",
"enabled": true,
"description": "匹配日期格式"
},
"电子邮箱": {
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"enabled": true,
"description": "匹配电子邮箱地址"
},
"银行卡号": {
"pattern": "(?<!\\d)([1-9]\\d{12,18})(?!\\d)",
"enabled": true,
"description": "匹配13-19位银行卡号"
},
"印章": {
"pattern": "__SEAL_DETECTION__",
"enabled": false,
"description": "使用 OpenCV 自动检测并脱敏红色印章区域(基于颜色和形状分析)"
}
},
"replacement_text": "[已脱敏]",
"custom_keywords": "",
"scan": {
"default_level": 1.0,
"available_levels": [1.0, 1.5, 2.0],
"level_labels": {
"1.0": "普通 (1.0x)",
"1.5": "标准 (1.5x 推荐)",
"2.0": "高精 (2.0x)"
}
},
"offset": {
"x_range": [-20, 20],
"w_range": [-20, 20],
"default_x": 0,
"default_w": 0
},
"precise_locator": {
"enabled": false,
"description": "启用像素级精准定位,通过垂直像素投影分析精确计算字符位置,可解决子字符串涂抹偏移问题,但会增加约20%处理时间。适合需要高精度涂抹的场景,如仅涂抹身份证号中的部分数字。"
},
"seal_detection": {
"enabled": false,
"description": "启用印章自动检测功能,使用 OpenCV 图像处理识别红色印章区域并自动脱敏",
"method": "opencv",
"min_red_ratio": 0.3,
"min_circularity": 0.5
}
},
"ocr": {
"min_rect_width": 5,
"progress_update_interval": 0.05,
"zoom_min": 0.5,
"zoom_max": 4.0,
"box_adjust_ratio": 0.0,
"box_adjust_range": [-0.30, 0.50],
"_comment_box_adjust": "检测框大小调节(-30%到+50%),负值扩大,正值收缩,0保持原样"
},
"security": {
"validate_paths": true,
"allowed_extensions": [".pdf", ".doc", ".docx"]
},
"ui": {
"theme": "auto",
"animation_enabled": true,
"show_tips": true
},
"advanced": {
"debug_mode": false,
"temp_cleanup_on_exit": true,
"cv2_num_threads": 0,
"omp_num_threads": 1
}
}