1. A method comprising: logically separating into a plurality of parts at least one sub-window of interest of a plurality of sub-windows of interest arranged in a grid formation in an autofocus window of interest; assigning a focus value mask to each of the plurality of parts of the at least one sub-window; and executing an autofocus algorithm using the assigned focus value masks, where the plurality of parts of the at least one sub-window of interest comprise a first part closest to a center of the at least one sub-window of interest, a third part farthest from the center of the at least one sub-window of interest, and a second part in between the first part and the second part, where the first part has a weighted focus value of Value 1 , the second part has a weighted focus value of Value 2 , and the third part has a weighted focus value of Value 3 , where Value 1 , Value 2 , and Value 3 each represent a rational value assigned to a corresponding focus value.