1. An image processing device that calculates a parameter used in alignment performed on at least two images captured by a photographing device that has a sensor detecting a movement, said image processing device comprising: an image obtaining unit configured to obtain an image captured by the photographing device; a sensor information obtaining unit configured to obtain sensor information that is an output signal from the sensor, the output signal being provided when the image obtained by said image obtaining unit is captured; a constraint condition generating unit configured to generate a constraint condition using the sensor information obtained by said sensor information obtaining unit such that a value of a parameter to be calculated falls within a range; and a parameter calculating unit configured to calculate the parameter related to the image obtained by said image obtaining unit, according to the constraint condition generated by said constraint condition generating unit, wherein said constraint condition generating unit includes: a feature vector generating unit configured to generate a feature vector showing a feature of the sensor information obtained by said sensor information obtaining unit; and a motion classifying unit configured to identify a movement of the photographing device according to the feature vector generated by said feature vector generating unit, on the basis of an association between the feature vector and the movement of the photographing device, the association is obtained as a result of previously-executed machine learning of the feature vector and an actual movement of the photographing device, and said constraint condition generating unit is configured to generate the constraint condition by determining the range corresponding to the movement of the photographing device, the movement being identified by said motion classifying unit.