1. An image processing apparatus comprising: a first detection unit configured to perform a first type of detection processing on an image; a second detection unit configured to perform a second type of detection processing for detecting a predetermined object from an area in the image, the area being detected through the first type of detection processing; a determination unit configured to, in a case where the predetermined object has not been detected by the second detection unit, determine an imaging condition for improving accuracy of the second type of detection processing; and a setting unit configured to set the imaging condition determined by the determination unit.