Compensating the effects of light attenuation in confocal microscopy by histogram modelling techniques