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); }
public bool IsPanelAvailable(SoftwareBitmap input, int Threshold) { _cvhelper.GetAvgBrightness(input, out double AvgBright); return(AvgBright >= Threshold); }