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.