From 6514501d1ad923c09f6f63d68fd7c8fd69e7c840 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Fri, 4 Dec 2015 14:21:26 +0100 Subject: [PATCH] [TASK] Fixed it, it was the wrong histogramm >.> --- imageviewer-qt4.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imageviewer-qt4.cpp b/imageviewer-qt4.cpp index 976f4f5..6e6676e 100644 --- a/imageviewer-qt4.cpp +++ b/imageviewer-qt4.cpp @@ -402,12 +402,14 @@ void ImageViewer::partialLinearHistogrammAdaption() { } } + double* original_histogramm = original->getRelativeCumulativeIntensityHistogramm(); + // Build up the brightness map to apply on the image // (basically inversing the histogramm map) int* brightness_map = (int*) malloc(256*sizeof(int)); int j=0; for(int i=0; i<256; i++) { - double old_cumulative_brightness = reference_histogramm[i]; + double old_cumulative_brightness = original_histogramm[i]; while(old_cumulative_brightness > histogramm_map[j]) j++; if(j > 255) j = 255; brightness_map[i] = j;