1. An apparatus comprising: a capturing unit configured to capture a target object; and a processor, the processor being programmed to function as: (1) a range image generation unit configured to generate a range image representing distance information from the capturing unit to the target object; (2) a general estimation unit configured to analyze the range image and estimate a general position and orientation of the target object; (3) a determination unit configured to determine a priority order of a plurality of identification units, each of which estimates a detailed position and orientation of the target object within a predetermined position and orientation range, based on the general position and orientation estimated by the general estimation unit; (4) a setting unit configured to set a search window indicating a range for detailed estimation of position and orientation of the range image based on a preregistered general size of the target object; (5) a calculation unit configured to calculate a difference between a first distance value of a first pixel in the range image and a second distance value of a second pixel which is next to the first pixel in the range image; (6) an updating unit configured to update the search window based on the calculated difference; and (7) a detailed estimation unit configured to estimate a detailed position and orientation of the target object, using the plurality of identification units in the priority order determined by the determination unit within the range of the search window.