Fix D2R region coordinates and HSV calibration from real screenshot
- Health orb: (370,945)-(460,1030) — verified red center RGB(196,18,16) - Mana orb: (1580,910)-(1670,1000) — verified blue center HSV(228,94,73) - Health HSV tightened to H 0-10, S 150+, V 150+ - Mana HSV tightened to H 200-240, S 100+, V 80+ - Belt, skill regions also recalibrated - 720p regions scaled proportionally
This commit is contained in:
parent
a665253d4d
commit
0716aeb5e1
6 changed files with 32 additions and 31 deletions
|
|
@ -56,11 +56,11 @@ type Config struct {
|
|||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
Colors: Colors{
|
||||
// Tightened HSV ranges based on real D2R screenshot calibration
|
||||
// Health orb is RED: H 0-30 (covering red wrapping), S 50-255, V 30-255
|
||||
HealthFilled: HSVRange{0, 50, 30, 30, 255, 255},
|
||||
// Mana orb is BLUE: H 200-240, S 40-255, V 20-255
|
||||
ManaFilled: HSVRange{200, 40, 20, 240, 255, 255},
|
||||
// Calibrated HSV ranges from real D2R screenshot (testdata/d2r_1080p.png)
|
||||
// Health orb is bright RED: RGB ~(236,15,20) → HSV H 0-10, S 150+, V 150+
|
||||
HealthFilled: HSVRange{0, 150, 150, 10, 255, 255},
|
||||
// Mana orb is BLUE: H 200-240, S 100+, V 80+
|
||||
ManaFilled: HSVRange{200, 100, 80, 240, 255, 255},
|
||||
ItemUnique: HSVRange{15, 100, 180, 30, 255, 255},
|
||||
ItemSet: HSVRange{35, 100, 150, 55, 255, 255},
|
||||
ItemRare: HSVRange{15, 50, 200, 25, 150, 255},
|
||||
|
|
@ -90,37 +90,38 @@ func DefaultConfig() Config {
|
|||
func RegisterProfiles(registry *resolution.Registry) error {
|
||||
profiles := []*resolution.Profile{
|
||||
// 1920x1080 (1080p) - Primary resolution
|
||||
// Calibrated from real D2R screenshot (testdata/d2r_1080p.png)
|
||||
{
|
||||
Width: 1920,
|
||||
Height: 1080,
|
||||
Label: "1080p",
|
||||
Regions: map[string]image.Rectangle{
|
||||
"health_orb": image.Rect(28, 545, 198, 715),
|
||||
"mana_orb": image.Rect(1722, 545, 1892, 715),
|
||||
"health_orb": image.Rect(370, 945, 460, 1030),
|
||||
"mana_orb": image.Rect(1580, 910, 1670, 1000),
|
||||
"xp_bar": image.Rect(0, 1058, 1920, 1080),
|
||||
"belt": image.Rect(838, 1010, 1082, 1058),
|
||||
"belt": image.Rect(500, 990, 900, 1040),
|
||||
"minimap": image.Rect(1600, 0, 1920, 320),
|
||||
"inventory": image.Rect(960, 330, 1490, 770),
|
||||
"stash": image.Rect(430, 330, 960, 770),
|
||||
"skill_left": image.Rect(194, 1030, 246, 1078),
|
||||
"skill_right": image.Rect(1674, 1030, 1726, 1078),
|
||||
"skill_left": image.Rect(200, 1030, 250, 1078),
|
||||
"skill_right": image.Rect(1670, 1030, 1730, 1078),
|
||||
},
|
||||
},
|
||||
// 1280x720 (720p) - Secondary resolution
|
||||
// 1280x720 (720p) - Secondary resolution (scaled from 1080p)
|
||||
{
|
||||
Width: 1280,
|
||||
Height: 720,
|
||||
Label: "720p",
|
||||
Regions: map[string]image.Rectangle{
|
||||
"health_orb": image.Rect(19, 363, 132, 477),
|
||||
"mana_orb": image.Rect(1148, 363, 1261, 477),
|
||||
"health_orb": image.Rect(247, 630, 307, 687),
|
||||
"mana_orb": image.Rect(1053, 607, 1113, 667),
|
||||
"xp_bar": image.Rect(0, 705, 1280, 720),
|
||||
"belt": image.Rect(559, 673, 721, 705),
|
||||
"belt": image.Rect(333, 660, 600, 693),
|
||||
"minimap": image.Rect(1067, 0, 1280, 213),
|
||||
"inventory": image.Rect(640, 220, 993, 513),
|
||||
"stash": image.Rect(287, 220, 640, 513),
|
||||
"skill_left": image.Rect(129, 685, 164, 718),
|
||||
"skill_right": image.Rect(1116, 685, 1151, 718),
|
||||
"skill_left": image.Rect(133, 687, 167, 718),
|
||||
"skill_right": image.Rect(1113, 687, 1153, 718),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue