Skip to content

Optimize auto-track for stationary camera: Gaussian blur + confidence threshold - #68

Merged
veillette merged 1 commit into
mainfrom
claude/optimize-auto-detect-point-0G57W
Feb 28, 2026
Merged

Optimize auto-track for stationary camera: Gaussian blur + confidence threshold#68
veillette merged 1 commit into
mainfrom
claude/optimize-auto-detect-point-0G57W

Conversation

@veillette

Copy link
Copy Markdown
Collaborator

For a fixed (non-panning) camera the background is static between frames,
making per-frame sensor noise and compression artefacts the dominant source
of false template matches.

Changes:

  • Apply a 5×5 Gaussian blur to both the template at capture time and the
    search region on every tracking call. Using the same filter in both
    places keeps TM_CCOEFF_NORMED scores accurate while suppressing the
    high-frequency noise that would otherwise produce spurious match peaks.
  • Return the TM_CCOEFF_NORMED confidence score (maxVal) from the worker with
    every track-result message.
  • Reject matches below a 0.25 confidence threshold in OpenCVTracker.track()
    to drop motion-blurred or heavily compressed frames without discarding
    genuine but imperfect matches.
  • Keep SEARCH_PADDING_FACTOR at 2, which is appropriate when the object's
    own motion is the sole source of inter-frame displacement.

https://claude.ai/code/session_01GJwcYz3EPjBY1rENbNR6MJ

… threshold

For a fixed (non-panning) camera the background is static between frames,
making per-frame sensor noise and compression artefacts the dominant source
of false template matches.

Changes:
- Apply a 5×5 Gaussian blur to both the template at capture time and the
  search region on every tracking call.  Using the same filter in both
  places keeps TM_CCOEFF_NORMED scores accurate while suppressing the
  high-frequency noise that would otherwise produce spurious match peaks.
- Return the TM_CCOEFF_NORMED confidence score (maxVal) from the worker with
  every track-result message.
- Reject matches below a 0.25 confidence threshold in OpenCVTracker.track()
  to drop motion-blurred or heavily compressed frames without discarding
  genuine but imperfect matches.
- Keep SEARCH_PADDING_FACTOR at 2, which is appropriate when the object's
  own motion is the sole source of inter-frame displacement.

https://claude.ai/code/session_01GJwcYz3EPjBY1rENbNR6MJ
@veillette
veillette merged commit f378946 into main Feb 28, 2026
1 check passed
@veillette
veillette deleted the claude/optimize-auto-detect-point-0G57W branch March 1, 2026 01:12
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.

2 participants