Skip to content

Add confidence-returning template matching (score / multi-scale / find-all)#337

Merged
JE-Chen merged 2 commits into
devfrom
feat/visual-match-batch
Jun 22, 2026
Merged

Add confidence-returning template matching (score / multi-scale / find-all)#337
JE-Chen merged 2 commits into
devfrom
feat/visual-match-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Summary

Round-11, automation-core (visual lane). The existing matcher (je_open_cv.find_object) is single-scale and discards the correlation score — no way to rank candidates, set a confidence threshold and read it back, match a DPI/zoom-scaled control, or enumerate every occurrence.

Layers

  • Headless core: je_auto_control/utils/visual_match/visual_match.pyMatch (x/y/width/height/score/scale/center), match_template (best, multi-scale), match_template_all (all, NMS-deduped), best_matches (top-N). Injectable haystack (ndarray/path/PIL) → headless-testable; OpenCV/NumPy imported lazily (via the je_open_cv dep). No PySide6.
  • Facade: re-exported (Match aliased to TemplateMatch) + __all__.
  • Executor: AC_match_template → {found, match}, AC_match_template_all → {count, matches}.
  • MCP: ac_match_template / ac_match_template_all.
  • Script Builder: two CommandSpecs under Image.

Tests / docs

  • test/unit_test/headless/test_visual_match_batch.py — 8 headless tests (score+box, no-match, find-all+NMS, multi-scale on a non-self-similar texture, unknown-method ValueError, to_dict + wiring + facade) on synthetic arrays, guarded by pytest.importorskip("cv2").
  • EN/Zh feature docs v127_features_doc.rst + toctrees; 3 WHATS_NEW entries.

Note: Codacy may show action_required from its coverage gate only (issues=0); SonarCloud + all GitHub Actions are the substantive gates.

@codacy-production

codacy-production Bot commented Jun 22, 2026

Copy link
Copy Markdown

Not up to standards ⛔

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 04d5167 into dev Jun 22, 2026
15 of 16 checks passed
@JE-Chen JE-Chen deleted the feat/visual-match-batch branch June 22, 2026 19:08
@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