In a method of determining whether an image of an eye is in focus a set of pixels is selected along a line passing through the pupil/iris boundary such that the set contains at least 5 iris portion pixels and at least 5 pupil portion pixels. Statistical values, preferably median values, are computed for all iris pixels in the selected set and for all pupil pixels in the selected set. The step size between the iris pixels and the pupil pixels is computed and absolute gradient values are computed for each pixel. The pixel having a largest absolute gradient value is excluded and an average of the absolute gradient values of the remaining pixels is found. If that average divided by the step size is greater than 0.5 the image is in focus and can be used for identifying a subject whose eye is in the image using iris identification techniques.