Enhancement and acceleration of the Retinex algorithm