Fix prototype: calibrate vision for real D2R screenshots, implement orb detection, improve dashboard

- Created debug tool (cmd/debug/main.go) to analyze real D2R screenshots and calibrate HSV ranges
- Fixed HSV color ranges for health/mana orbs based on real screenshot analysis (99.5% and 82% detection rates)
- Replaced ReadBarPercentage with ReadOrbPercentage for circular orbs (not horizontal bars)
- Added SetSource() method to capture Manager for hot-swapping capture sources
- Fixed dashboard JavaScript null reference errors with proper array checks
- Improved dashboard refresh rate from 100ms to 1000ms for better performance
- Added proper error handling for empty/null API responses
- Successfully detecting game state, health (99.5%), and mana (82%) from real D2R screenshot
This commit is contained in:
Hoid 2026-02-14 10:55:30 +00:00
parent 4ebed5e3ab
commit 4f0b84ec31
10 changed files with 473 additions and 19 deletions

View file

@ -56,8 +56,11 @@ type Config struct {
func DefaultConfig() Config {
return Config{
Colors: Colors{
HealthFilled: HSVRange{0, 100, 100, 10, 255, 255},
ManaFilled: HSVRange{100, 100, 100, 130, 255, 255},
// Updated ranges based on real D2R screenshot analysis
// Health orb - includes the actual colors found (olive/brown when low, reds when high)
HealthFilled: HSVRange{0, 30, 10, 100, 255, 255}, // Wide range: reds through yellows/browns
// Mana orb - includes the actual colors found (dark/brown when low, blues when high)
ManaFilled: HSVRange{40, 20, 10, 250, 255, 255}, // Browns through blues
ItemUnique: HSVRange{15, 100, 180, 30, 255, 255},
ItemSet: HSVRange{35, 100, 150, 55, 255, 255},
ItemRare: HSVRange{15, 50, 200, 25, 150, 255},