Gradient-based contrast enhancement and color correction for underwater images