1. An image processing apparatus comprising: a detection unit configured to scan an input image and each of images at different resolutions, which are generated from the input image, by a predetermined-sized window to detect an object in the image; a storage unit configured to store a detection result of the detection unit; and a control unit configured to, if there is no free space in the storage unit to store a new detection result of the detection unit, store the new detection result instead of a detection result of an image at higher resolution than resolution of an image from which the new detection result is acquired.