Aiming at the problem that the focus range and focus accuracy cannot be balanced during the focusing process of scenes with small targets in a large field of view such as ships in the ocean, this paper proposes a selection of the focusing window based on gradient matrix and an adjustable coverage range autofocus evaluation function in frequency domain. By using gradient operators of different sizes for different search intervals, the gradient matrix of the image can be obtained. This kind of strategy takes both accuracy and detection rate into consideration. Through segmentation, area with rich details could be chosen as the focusing window. In order to solve the problem that the focusing evaluation function don’t works well when the amount of defocus blur is large, this paper proposes a new evaluation function based on an amplitude summation of different frequency component with variable threshold. For the scenes with small target in a large filed of view, more than 100 pictures with continuously changing defocus were established. Experiments indicate that the method proposed in this paper can meet the characteristics of a wide focusing range and high sensitivity at the same time when variable threshold was used. Compared with existing methods, the method above performs better in noise robustness and has a larger coverage range, at the same time, it provides a sharper peak of evaluation function which means higher sensitivity.