Add match_ensemble: multi-template consensus matching#393
Merged
Conversation
A button renders in several states (default/hover/pressed) but is one logical target; ab_locator picks one strategy and match_template(scales=) sweeps one template - neither fuses multiple references. Match each reference, cluster the hit centres, and accept only when >= min_votes agree within agree_px, returning the consensus point. Reuses visual_match.match_template + grounding_consensus; vote_centers is the pure voting core.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 15 |
| 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_ensemble/vote_centers— 把同一目標的多個參考裁切投票成單一可信位置。一個按鈕常以多種狀態呈現(預設/懸停/按下/停用)但是單一邏輯目標;ab_locatorA/B 測哪個單一策略勝出、match_template(scales=...)跨縮放掃一個模板——兩者都不把多參考融合成一次投票。本功能比對每個參考,聚類命中中心,只有在至少
min_votes個參考於agree_px內一致時才接受目標,回傳{point, votes, n_candidates, spread}——大幅減少換膚/動畫 UI 的誤判。投票核心vote_centers為純標準函式庫並重用grounding_consensus聚類(可無影像測試);只有match_ensemble呼叫visual_match.match_template(可於注入合成 haystack 測試)。Qt-free。五層
utils/match_ensemble/—match_ensemble、vote_centers。AC_match_ensemble+AC_vote_centers/ MCPac_match_ensemble+ac_vote_centers/ Script Builder(Image)。測試
test_match_ensemble_batch.py— vote_centers 多數一致 + votes/n、票數不足→None、空→None、注入 haystack 三參考共識、wiring + facade。6 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。