. . . "If it is determined that the detected jitter value based on the reference value of the defocus value is a value greater than the predetermined jitter value, the jitter value is detected every time the defocus value is changed stepwise within the predetermined range of numeric values including the reference value of the defocus value, and the optimum defocus value corresponding to the medium is set" .