修复: OCR cap_top 跳过群名头栏 + 行级群名头栏过滤
1. cap_top 从 max(40, 4%)→max(80, 6%):跳过 TIM 聊天面板 顶部群名+角色标签头栏(~70px),之前只跳过了 Windows 标题栏 2. 行级内容过滤:行首匹配 '名称(角色〕' / 【名称】等 header 模式 (闭合括号为 〕」】 等非日常聊天用符号)—— cap_top 残余的二次防御 3. 防止 OCR 将群名头栏+消息预览混成一条无时间戳的乱码”新消息
This commit is contained in:
+6
-1
@@ -679,7 +679,7 @@ class MessageMonitor:
|
||||
# 退回 c9acd7e 裁剪: 25% 覆盖消息面板两侧(对方+自己消息都可见)
|
||||
# 右边界 78% 排除群成员侧栏(~80%+), md 过滤负责拦截 bot 的 md 格式回复
|
||||
cap_left = int(left + win_w * 0.25)
|
||||
cap_top = top + max(40, int(win_h * 0.04)) # 标题栏下方
|
||||
cap_top = top + max(80, int(win_h * 0.06)) # 跳过标题栏+群名头栏
|
||||
cap_right = int(left + win_w * 0.78) # 跳过右栏群成员列表(~80%+) 和滚动条
|
||||
cap_bottom = bottom - max(100, int(win_h * 0.10)) # 输入框上方
|
||||
if cap_right <= cap_left or cap_bottom <= cap_top:
|
||||
@@ -790,6 +790,11 @@ class MessageMonitor:
|
||||
if re.search(r'群成员|索群成员|搜索成员', line):
|
||||
logger.debug(f"[qq] OCR 过滤: 群成员侧栏 line={line[:60]!r}")
|
||||
continue
|
||||
# 聊天面板顶部群名头栏:群名(角色〕/ 【群名】/ 群名[标签]
|
||||
# 特有签名:使用 `〕` `」` `】` 等非日常聊天中出现的闭合括号
|
||||
if re.match(r'^[^)】〕」]{2,40}[(【〔「][^)】〕」]{1,15}[)】〕」]', line):
|
||||
logger.debug(f"[qq] OCR 过滤: 群名头栏 line={line[:60]!r}")
|
||||
continue
|
||||
# 纯中文短文本(1 字符)— UI 噪声碎片
|
||||
if re.match(r'^[一-鿿]{1}$', line):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user