Wavelet-based denoising is provided to an image. A corrected reference
image is acquired and stored. A test image is adjusted using a selected
gain setting such that the mean pixel value of the adjusted test image
matches the mean pixel value of the reference image. The adjusted image
is decomposed into sub-bands using a wavelet transformation. Thresholding
is applied to a selected sub-band with a selected threshold setting. An
inverse wavelet transformation is then applied to the sub-bands to
provide a denoised image. This process is repeated such that each
sub-band is tested with multiple threshold settings. The denoised images
are analyzed to locate a threshold setting that is approximately optimal
for each sub-band. This process is repeated for multiple light settings.
A gain-threshold map is constructed by mapping each selected gain setting
to the approximately optimal threshold settings for each sub-band at the
selected gain setting.