The health and shield bar percentages could be measured by counting pixels. For instance you could draw a horizontal line across the bar and see how many pixels are lit up.