Me and my project group are making an Paintball-like Android app. When you shoot someone it checks the following things:
- Is the opponent's color in the cross-hair (center of screen)? (either fluor yellow or fluor orange vests)
- Is their an opponent player in that direction (use of device compass)?
- Is their an opponent in range in that direction (use of GPS)?
The problem at the moment is with the first check. We plan to use the HUE and/or HSV codes, including the lightness and saturation by using the Color.colorToHSV method in Android. We encounter some problems though when it is too dark (weather), and want some feedback over which method is the most efficient to get the best possible results for our colored vests.
With some tests we use the following range at the moment with the Color.colorToHSV method:
float[] currentHsv = new float[3];
Color.colorToHSV(Utils.findColor(myImageBitmap), currentHsv);
float hue = currentHsv[0];
float saturation = currentHsv[1];
float brightness = currentHsv[2];
// Fluor Yellow
if((hue >= 58 && hue <=128) && brightness > 0.40 && saturation <= 1.0){ // some code here }
// Fluor orange
else if((hue >= 4 && hue <=57) && brightness > 0.45 && saturation >= 0.62){ // some code here }
Does anyone know a more efficient way of doing this, which works in almost any kind of weather type, dark or light, inside or outside, below dark bridges or overhanging buildings, dark/light colored clothings underneed it, etc.