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;