Trikot-Erkennung verbessert: OCR auf ganzer Person + ganzem Bild, kleinere Nummern (Brust/Hose), Nummern in Text ('HUTH 10'), Teamfarbe direkt um die Nummer; erkannte Nummern ohne Team/Code sichtbar, gemessene Farbe angezeigt; Cache neu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
Lichtkasten DevandClaude Opus 5.5 committed 2026-11-04 01:26:42 +00:00
1 parent 3aa5bdef0e
commit 43405abd67
4 files changed
+121 -63

No files matched your search

+18 -6
View File
@@ -87,7 +87,8 @@ struct IPTCInfoWindow: View {
// MARK: Jersey suggestions
private var openSuggestions: [JerseySuggestion] { item.map { state.openSuggestions(for: $0.id) } ?? [] }
private var openSuggestions: [JerseySuggestion] { item.map { state.allOpenSuggestions(for: $0.id) } ?? [] }
private var acceptable: [JerseySuggestion] { openSuggestions.filter { $0.replacement != nil } }
@ViewBuilder
private var suggestionBar: some View {
@@ -98,20 +99,31 @@ struct IPTCInfoWindow: View {
Image(systemName: "person.text.rectangle").foregroundStyle(Color.accentColor)
Text("Erkannt:").bold()
Spacer()
if open.count > 1 {
Button("Alle annehmen") { accept(open) }
if acceptable.count > 1 {
Button("Alle annehmen") { accept(acceptable) }
}
Button("Neu erkennen") { state.recognizeJerseys([item], onlyNew: false) }
.controlSize(.small)
}
ForEach(Array(open.enumerated()), id: \.element.id) { idx, s in
HStack(spacing: 8) {
if let c = s.measuredColor {
RoundedRectangle(cornerRadius: 3)
.fill(Color(red: c.r, green: c.g, blue: c.b))
.frame(width: 14, height: 14)
.overlay(RoundedRectangle(cornerRadius: 3).stroke(Color.secondary))
.help("Gemessene Trikotfarbe um die Nummer – passt sie nicht zum Team, Farbe in „Trikot-Erkennung einrichten“ anpassen")
}
Text(s.code ?? "#\(s.number)").font(.system(.body, design: .monospaced)).bold()
Text(s.replacement ?? "–").lineLimit(1)
Text(s.regions.map(\.rawValue).joined(separator: "+") + " · \(Int(s.confidence * 100)) %")
Text(s.replacement ?? "Nummer erkannt – kein Team/Code gefunden").lineLimit(1)
.foregroundStyle(s.replacement == nil ? .secondary : .primary)
Text(s.regions.map(\.rawValue).joined(separator: "+") + " · \(Int(s.confidence * 100)) %"
+ (s.teamCertain == false ? " · Team unsicher" : ""))
.font(.caption).foregroundStyle(.secondary)
Spacer()
if idx == 0 {
if s.replacement == nil {
EmptyView()
} else if s.id == acceptable.first?.id {
Button("Annehmen (⌘J)") { accept([s]) }
.keyboardShortcut("j", modifiers: .command)
.buttonStyle(.borderedProminent)