In a case where generating a training image of an object to be used to generate a dictionary to be referred to in image recognition processing of detecting the object from an input image, model information of an object to be detected is set, and a luminance image of the object and a range image are input. The luminance distribution of the surface of the object is estimated based on the luminance image and the range image, and the training image of the object is generated based on the model information and the luminance distribution.