Пример #1
0
        public static Color GetColorFromHSV(FastPixelHSV pixel)
        {
            int R = 0, G = 0, B = 0;

            HsvToRgb(pixel.GetHue(), pixel.GetSaturation() / 100.0, pixel.GetValue() / 100.0, out R, out G, out B);
            return(Color.FromArgb(R, G, B));
        }
Пример #2
0
        public override bool IsMatching(FastPixelHSV pixel)
        {
            int Hue        = pixel.GetHue();
            int Saturation = pixel.GetSaturation();

            return((Hue >= HueMin) && (Hue <= HueMax) &&
                   (Saturation >= SaturationMin) && (Saturation <= SaturationMax) &&
                   (pixel.Value >= ValueMin) && (pixel.Value <= ValueMax));
        }
Пример #3
0
        public override bool IsMatching(FastPixelHSV pixel)
        {
            if ((pixel.Monochrome >= MonoMin) && (pixel.Monochrome <= MonoMax))
            {
                int Hue = pixel.GetHue();
                return((Hue >= HueMin) && (Hue <= HueMax));
            }

            return(false);
        }
Пример #4
0
        public static float GetPixelFeaturesHueMono(FastPixelHSV testPx)
        {
            const int hueSteps  = 16;
            const int monoSteps = 16;

            const float monoScale = 1.0f / monoSteps;
            const float hueScale  = monoScale / hueSteps;

            int hueV  = testPx.GetHue() / (360 / hueSteps);
            int monoV = testPx.GetMonochrome() / (256 / monoSteps);

            float pixelV = (hueV * hueScale) + (monoV * monoScale);

            return(pixelV);
        }
Пример #5
0
 public static float GetPixelFeaturesHue(FastPixelHSV testPx)
 {
     return(testPx.GetHue() / 360.0f);
 }