/// <summary> /// Processes BitmapSource to normalize histogram. /// </summary> /// <param name="bitmap"></param> /// <returns></returns> public BitmapSource Process(BitmapSource bitmap) { Histogram histogram = new Histogram(); histogram.CreateHistogram(bitmap); LUTProcess lut = new LUTProcess(); lut.SetLUT(CreateLUT(histogram.HistogramValues)); return(lut.Process(bitmap)); }
/// <summary> /// Processes BitmapSource to equalize histogram. /// </summary> /// <param name="bitmap"></param> /// <returns></returns> public BitmapSource Process(BitmapSource bitmap) { BitmapSource outcome = bitmap; Histogram histogram = new Histogram(); if (histogram.CreateHistogram(bitmap)) { LUTProcess lut = new LUTProcess(); lut.SetLUT(CreateLUT(histogram.HistogramValues)); outcome = lut.Process(bitmap); } return(outcome); }