An image processing device comprising: a first attitude optimization unit configured to, with respect to a human body region extracted from an input image, optimize an attitude parameter of a human body model by using a first optimization algorithm, wherein the attitude parameter of the human body model includes an articulation position and angle, and a number of articulations; a second attitude optimization unit configured to, with respect to the human body region, optimize the attitude parameter of the human body model by using a second optimization algorithm different from the first optimization algorithm; an object detection unit configured to detect an object from the input image; a degree-of-reliability evaluation unit; and a selection unit configured to select one of the following: 1. in response to the object detection unit detecting an object, select a predetermined one of the first attitude optimization unit or second attitude optimization unit to generate an optimization result; 2. otherwise, when no object is detected by the object detection unit, select one of a first optimization result obtained by the first attitude optimization unit or a second optimization result obtained by the second attitude optimization unit, based on a first degree of reliability of the first optimization result and a second degree of reliability of the second optimization result, wherein the degree-of-reliability evaluation unit is configured to evaluate the first degree of reliability and the second degree of reliability. a first attitude optimization unit configured to, with respect to a human body region extracted from an input image, optimize an attitude parameter of a human body model by using a first optimization algorithm, wherein the attitude parameter of the human body model includes an articulation position and angle, and a number of articulations; a second attitude optimization unit configured to, with respect to the human body region, optimize the attitude parameter of the human body model by using a second optimization algorithm different from the first optimization algorithm; an object detection unit configured to detect an object from the input image; a degree-of-reliability evaluation unit; and a selection unit configured to select one of the following: 1. in response to the object detection unit detecting an object, select a predetermined one of the first attitude optimization unit or second attitude optimization unit to generate an optimization result; 2. otherwise, when no object is detected by the object detection unit, select one of a first optimization result obtained by the first attitude optimization unit or a second optimization result obtained by the second attitude optimization unit, based on a first degree of reliability of the first optimization result and a second degree of reliability of the second optimization result, 1. in response to the object detection unit detecting an object, select a predetermined one of the first attitude optimization unit or second attitude optimization unit to generate an optimization result; 2. otherwise, when no object is detected by the object detection unit, select one of a first optimization result obtained by the first attitude optimization unit or a second optimization result obtained by the second attitude optimization unit, based on a first degree of reliability of the first optimization result and a second degree of reliability of the second optimization result, wherein the degree-of-reliability evaluation unit is configured to evaluate the first degree of reliability and the second degree of reliability.