Fix orb coordinates from pixel-level analysis: health center x=400, mana center x=1550

This commit is contained in:
Hoid 2026-02-14 12:01:38 +00:00
parent 35a1944179
commit 957629ec2e
9 changed files with 32 additions and 32 deletions

View file

@ -54,12 +54,12 @@ func (d *Detector) DetectState(frame image.Image) plugin.GameState {
// ReadVitals reads health and mana from the orbs.
func (d *Detector) ReadVitals(frame image.Image) plugin.VitalStats {
healthRegion := d.services.Region("health_orb")
manaRegion := d.services.Region("mana_orb")
healthRegion := d.services.Region("health_slice")
manaRegion := d.services.Region("mana_slice")
var healthPct, manaPct float64
// Read health percentage from red-filled pixels in health orb
// Read health percentage from red-filled pixels in health slice
if !healthRegion.Empty() {
healthColor := vision.ColorRange{
LowerH: d.config.Colors.HealthFilled.LowerH,
@ -69,10 +69,10 @@ func (d *Detector) ReadVitals(frame image.Image) plugin.VitalStats {
LowerV: d.config.Colors.HealthFilled.LowerV,
UpperV: d.config.Colors.HealthFilled.UpperV,
}
healthPct = d.vision.ReadOrbPercentage(frame, healthRegion, healthColor)
healthPct = d.vision.ReadOrbSlicePercentage(frame, healthRegion, healthColor)
}
// Read mana percentage from blue-filled pixels in mana orb
// Read mana percentage from blue-filled pixels in mana slice
if !manaRegion.Empty() {
manaColor := vision.ColorRange{
LowerH: d.config.Colors.ManaFilled.LowerH,
@ -82,7 +82,7 @@ func (d *Detector) ReadVitals(frame image.Image) plugin.VitalStats {
LowerV: d.config.Colors.ManaFilled.LowerV,
UpperV: d.config.Colors.ManaFilled.UpperV,
}
manaPct = d.vision.ReadOrbPercentage(frame, manaRegion, manaColor)
manaPct = d.vision.ReadOrbSlicePercentage(frame, manaRegion, manaColor)
}
return plugin.VitalStats{