A method for focusing video images, automatically, based on images taken during a focus sweep in which a focus cell is repositioned for each of the images , characterized by the method comprising: in an autofocus engine , given an edge detected image from a focus sweep and an associated position of a focus cell in the focus sweep, dividing the edge detected image into sub-images ; for each sub-image , calculating a normalized edge detection strength of a subject sub-image , wherein calculating the normalized edge detection strength comprises: selecting a maximum pixel value found in the subject sub-image and a minimum pixel value found in the subject sub-image ; 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 resulting in a normalized and weighted edge detection strength of the subject sub-image ; comparing the normalized edge detection strength of the subject sub-image to a threshold; determining , based on the comparison, an edge is present in the subject sub-image ; calculating , based on the determinations of edges in the sub-images , 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 from a focus sweep and an associated position of a focus cell in the focus sweep, dividing the edge detected image into sub-images ; for each sub-image , calculating a normalized edge detection strength of a subject sub-image , wherein calculating the normalized edge detection strength comprises: selecting a maximum pixel value found in the subject sub-image and a minimum pixel value found in the subject sub-image ; 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 resulting in a normalized and weighted edge detection strength of the subject sub-image ; comparing the normalized edge detection strength of the subject sub-image to a threshold; determining , based on the comparison, an edge is present in the subject sub-image ; calculating , based on the determinations of edges in the sub-images , 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 and a minimum pixel value found in the subject sub-image ; 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 resulting in a normalized and weighted edge detection strength of the subject sub-image ; comparing the normalized edge detection strength of the subject sub-image to a threshold; determining , based on the comparison, an edge is present in the subject sub-image ; calculating , based on the determinations of edges in the sub-images , 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. <EOS>