Update invariant table.

Boosted gain by 3X.
This commit is contained in:
Kwabena W. Agyeman 2018-01-06 11:07:16 -05:00
parent 02619af915
commit edffa55873
3 changed files with 4098 additions and 4100 deletions

View File

@ -1118,7 +1118,7 @@ void imlib_illuminvar(image_t *img) // http://ai.stanford.edu/~alireza/publicati
float chi_x = (r_lin_sharp_div_log * 0.7071f) + (g_lin_sharp_div_log * -0.7071f) + (b_lin_sharp_div_log * 0.0000f);
float chi_y = (r_lin_sharp_div_log * 0.4082f) + (g_lin_sharp_div_log * 0.4082f) + (b_lin_sharp_div_log * -0.8164f);
int chi_int = IM_MAX(IM_MIN(fast_roundf(fast_expf((chi_x * 0.9326f) + (chi_y * -0.3609f)) * 42.99f), COLOR_GRAYSCALE_MAX), COLOR_GRAYSCALE_MIN);
int chi_int = IM_MAX(IM_MIN(fast_roundf(fast_expf((chi_x * 0.9326f) + (chi_y * -0.3609f)) * 127.5f), COLOR_GRAYSCALE_MAX), COLOR_GRAYSCALE_MIN);
#endif
IMAGE_PUT_RGB565_PIXEL_FAST(row_ptr, x, COLOR_R8_G8_B8_TO_RGB565(chi_int, chi_int, chi_int));
}

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,7 @@ for i in range(65536):
chi_x = (r_lin_sharp_div_log * 0.7071) + (g_lin_sharp_div_log * -0.7071) + (b_lin_sharp_div_log * 0.0000)
chi_y = (r_lin_sharp_div_log * 0.4082) + (g_lin_sharp_div_log * 0.4082) + (b_lin_sharp_div_log * -0.8164)
chi_int = max(min(int(round(math.exp((chi_x * 0.9326) + (chi_y * -0.3609)) * 42.99)), 255), 0)
chi_int = max(min(int(round(math.exp((chi_x * 0.9326) + (chi_y * -0.3609)) * 127.5)), 255), 0)
if not (i % 16):
sys.stdout.write(" ")
@ -56,4 +55,3 @@ for i in range(65536):
sys.stdout.write(",\n")
else:
sys.stdout.write("\n};\n")