1. An image pickup apparatus comprising: a generation unit configured to generate first image data, when an in-focus position is a first focal position at which an object is in focus state or a second focal position on a near distance side of the first focal position, and second image data generated by the generation unit, when an in-focus position is a third focal position on a far distance side of a focal position at which a background is in focus state; and a discrimination unit configured, based on the first and second image data generated by the generation unit, to discriminate between a first region including the object, and a second region including the background.