Phase curvature compensation in digital holographic microscopy based on phase gradient fitting and optimization