Skip to content

Add subpixel_match: sub-pixel template-match refinement#384

Merged
JE-Chen merged 1 commit into
devfrom
feat/subpixel-match-batch
Jun 23, 2026
Merged

Add subpixel_match: sub-pixel template-match refinement#384
JE-Chen merged 1 commit into
devfrom
feat/subpixel-match-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

摘要

新增 match_subpixel / refine_peak — 將比對中心精修到次像素精度。每個比對器都直接從 cv2.minMaxLoc 回傳整數座標;對拖曳把手、細滑桿、次像素渲染目標或高 DPI 顯示器,整數捨入是主要的點擊落點誤差來源。本功能以拋物線擬合峰值周圍的 3×3 分數鄰域(x/y 各自獨立,標準 NCC 次像素法),回傳浮點 cx / cy。重用 visual_match._score_map(公開比對器丟棄的完整 matchTemplate 曲面);haystack 可注入;Qt-free。

五層

  • 核心:utils/subpixel_match/SubPixelMatchmatch_subpixelrefine_peak
  • Facade / Executor AC_match_subpixel / MCP ac_match_subpixel / Script Builder Match Template (sub-pixel)(Image)。
  • 文件:v171 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test_subpixel_match_batch.py — 對稱峰偏移 0、右鄰較高→ +x 偏移、定位 + 中心、min_score 過濾、wiring + facade。6 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。

Every matcher returns integer coordinates from cv2.minMaxLoc; for a drag
handle, fine slider or high-DPI display that rounding is the dominant
click-placement error. Fit a parabola to the 3x3 score neighbourhood around the
peak (independently on x/y) and return a float cx/cy. Reuses
visual_match._score_map.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 25 complexity · 0 duplication

Metric Results
Complexity 25
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 8b00dad into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/subpixel-match-batch branch June 23, 2026 21:17
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant