1. A method for focusing an image, the method comprising: defining an objective function configured to perform an entropy calculation; performing optimization to identify an array of coefficients for a polynomial representing a phase correction in a manner that minimizes an entropy value generated by an entropy calculation for the image, wherein the objective function generates a new entropy value for the array of coefficients during an optimization period and iteratively reduces the entropy value until a threshold is reached; responsive to reaching the threshold, applying the array of coefficients to the polynomial to obtain a desired phase correction; and correcting a phase error in the image using the desired phase correction to focus the image.