A non-transitory storage medium readable by a computer, the storage medium storing a program that is executable by the computer, wherein the program includes program code for causing the computer to realize a method for calculating an in-focus position of a focus lens based on a signal obtained from an image sensor of an image capturing apparatus that includes:
- the image sensor that is sensitive to light in a first wavelength band and light in a second wavelength band, the light being incident on the image sensor via an imaging optical system that includes the focus lens;
- and an optical filter having a first filter region that selectively allows the passage of light in the first wavelength band therethrough, the optical filter being provided between the imaging optical system and the image sensor, the method comprising:
- estimating a first component in the first wavelength band and a second component in the second wavelength band of light received by a second pixel region, based on a first signal obtained from a first pixel region and a second signal obtained from the second pixel region, the first pixel region being a region in a pixel region of the image sensor and being for receiving light that has passed through the first filter region, and the second pixel region being a region in the pixel region of the image sensor excluding the first pixel region;
- and
- calculating an in-focus position of the focus lens with respect to a predetermined shooting distance based on the first component and the second component.