Automatic gamma correction based on average of brightness
Digital Image Processing