A method for focusing video images, automatically, based on images (205, 210) taken during a focus sweep in which a focus cell is repositioned for each of the images (205, 210), characterized by the method comprising: in an autofocus engine, given an edge detected image (215, 220) from a focus sweep and an associated position of a focus cell in the focus sweep, dividing the edge detected image (215, 220) into sub-images (225, 230); for each sub-image (225, 230), calculating a normalized edge detection strength of a subject sub-image (225, 230), wherein calculating the normalized edge detection strength comprises: selecting a maximum pixel value found in the subject sub-image (225, 230) and a minimum pixel value found in the subject sub-image (225, 230); forming a ratio of a difference of the maximum pixel value and minimum pixel value to a sum of the maximum pixel value and minimum pixel value, the ratio being a contrast measure; and multiplying the contrast measure with a mean of the pixel values in the sub-image (225, 230) resulting in a normalized and weighted edge detection strength of the subject sub-image (225, 230); comparing the normalized edge detection strength of the subject sub-image (225, 230) to a threshold; determining, based on the comparison, an edge is present in the subject sub-image (225, 230); calculating, based on the determinations of edges in the sub-images (225, 230), an autofocus metric associated with the given position of the focus cell; and providing the autofocus metric together with autofocus metrics associated with other positions of the focus cell to focus video images. in an autofocus engine, given an edge detected image (215, 220) from a focus sweep and an associated position of a focus cell in the focus sweep, dividing the edge detected image (215, 220) into sub-images (225, 230); for each sub-image (225, 230), calculating a normalized edge detection strength of a subject sub-image (225, 230), wherein calculating the normalized edge detection strength comprises: selecting a maximum pixel value found in the subject sub-image (225, 230) and a minimum pixel value found in the subject sub-image (225, 230); forming a ratio of a difference of the maximum pixel value and minimum pixel value to a sum of the maximum pixel value and minimum pixel value, the ratio being a contrast measure; and multiplying the contrast measure with a mean of the pixel values in the sub-image (225, 230) resulting in a normalized and weighted edge detection strength of the subject sub-image (225, 230); comparing the normalized edge detection strength of the subject sub-image (225, 230) to a threshold; determining, based on the comparison, an edge is present in the subject sub-image (225, 230); calculating, based on the determinations of edges in the sub-images (225, 230), an autofocus metric associated with the given position of the focus cell; and providing the autofocus metric together with autofocus metrics associated with other positions of the focus cell to focus video images. selecting a maximum pixel value found in the subject sub-image (225, 230) and a minimum pixel value found in the subject sub-image (225, 230); forming a ratio of a difference of the maximum pixel value and minimum pixel value to a sum of the maximum pixel value and minimum pixel value, the ratio being a contrast measure; and multiplying the contrast measure with a mean of the pixel values in the sub-image (225, 230) resulting in a normalized and weighted edge detection strength of the subject sub-image (225, 230); comparing the normalized edge detection strength of the subject sub-image (225, 230) to a threshold; determining, based on the comparison, an edge is present in the subject sub-image (225, 230); calculating, based on the determinations of edges in the sub-images (225, 230), an autofocus metric associated with the given position of the focus cell; and providing the autofocus metric together with autofocus metrics associated with other positions of the focus cell to focus video images.