Fixed auto-exposure on image with large overexposed areas

on behalf of Victor, see issue 1358
This commit is contained in:
Oliver Duis
2012-10-02 20:24:29 +02:00
parent 8b2137f68c
commit c55f4e65e2

View File

@@ -1196,7 +1196,7 @@ fclose(f);*/
//find average luminance
for (int i=0; i<imax; i++) {
sum += histogram[i];
ave += histogram[i] * i;
ave += histogram[i] *(float)i;
}
ave /= (sum);
@@ -1253,6 +1253,10 @@ fclose(f);*/
if (octile[7]>log(imax+1)/log2(2)) {
octile[7]=1.5*octile[6]-0.5*octile[5];
}
for(int i=1; i<8; i++) {
if (octile[i] == 0.0)
octile[i] = octile[i-1];
}
// compute weighted average separation of octiles
// for future use in contrast setting
for (int i=1; i<6; i++) {