Add subpixel_match: sub-pixel template-match refinement#384
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 25 |
| Duplication | 0 |
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



摘要
新增
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/—SubPixelMatch、match_subpixel、refine_peak。AC_match_subpixel/ MCPac_match_subpixel/ Script Builder Match Template (sub-pixel)(Image)。測試
test_subpixel_match_batch.py— 對稱峰偏移 0、右鄰較高→ +x 偏移、定位 + 中心、min_score 過濾、wiring + facade。6 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。