Optimization of tone-mapping functions in video cameras for high dynamic range images