[TASK] Fixed it, it was the wrong histogramm >.>
This commit is contained in:
parent
662f990877
commit
6514501d1a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue