fix: cap adattivo al 50% varianti + form e finestra risultati ridimensionabili

- max_vars_full = max(max_matches*8, n_variants // 2): protegge perf con
  molte scale mantenendo metà delle varianti al full-res (vs intero senza cap
  che dava 22s su 864 varianti, vs 80s screenshot utente)
- Dialog tkinter: resizable, minsize 360x420, Entry col peso 2 espandibile
- Finestra risultati cv2: WINDOW_NORMAL con resizeWindow iniziale 1600x900

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 01:57:20 +02:00
parent 9a0da7aac8
commit d27676cfe6
2 changed files with 18 additions and 4 deletions
+5 -2
View File
@@ -542,9 +542,12 @@ class LineShapeMatcher:
if not kept_variants:
return []
# Cap: tutte le varianti che superano top_thresh passano al full-res.
# Ordinamento per score decrescente (early matches hanno priorità).
# Cap adattivo: ordina per score top-level e mantieni le più promettenti.
# Min: max_matches*8 (margine per NMS cross-variant)
# Max: 50% delle varianti totali (protegge performance con molte scale)
kept_variants.sort(key=lambda t: -t[1])
max_vars_full = max(max_matches * 8, len(self.variants) // 2)
kept_variants = kept_variants[:max_vars_full]
# Full-res (parallelizzato per variante)
resp0 = self._response_map(gray0)