Esempio n. 1
0
        public double CalcBrightness(SoftwareBitmap softwareBitmap)
        {
            _cvhelper.GetAvgBrightness(softwareBitmap, out double val);

            if (Threshold == null)
            {
                Samples.Add(val);
                if (Samples.Count >= SampleLimit)
                {
                    Threshold = (int)(Samples.Average() * 0.85);
                }
            }

            Latest = val;
            return(val);
        }
Esempio n. 2
0
 public bool IsPanelAvailable(SoftwareBitmap input, int Threshold)
 {
     _cvhelper.GetAvgBrightness(input, out double AvgBright);
     return(AvgBright >= Threshold);
 }