A picture processing device comprising: a picture obtainment unit configured to obtain a first picture and a second picture, the first picture being taken before the second picture is taken; a feature point extraction unit configured to extract feature points from the first picture and feature points from the second picture; a masking picture generation unit configured to generate a masking picture based on edges in the first picture, the masking picture masking a region showing an object which is a structural object among objects in the first picture; a feature point masking unit configured to mask the feature points of the first picture extracted by said feature point extraction unit, with the masking picture generated by said masking picture generation unit, so as not to be influenced by an object in a near view or a natural object in a distant view; a calculation unit configured to calculate a positional relationship between the first picture and the second picture based on the feature point specified from the feature points as a result of the masking by said feature point masking unit and the extracted feature points of the second picture; and a picture correction unit configured to correct one of the first picture and the second picture based on the positional relationship calculated by said calculation unit, characterized in that said masking picture generation unit is configured to (i) determine a first region including first pixels which are pixels each having a peak angle of an angle histogram generated based on angle information calculated based on the edges in the first picture, (ii) determine a second region obtained by expanding the first region by making use of the angle information, and (iii) generate the masking picture masking the second region. a picture obtainment unit configured to obtain a first picture and a second picture, the first picture being taken before the second picture is taken; a feature point extraction unit configured to extract feature points from the first picture and feature points from the second picture; a masking picture generation unit configured to generate a masking picture based on edges in the first picture, the masking picture masking a region showing an object which is a structural object among objects in the first picture; a feature point masking unit configured to mask the feature points of the first picture extracted by said feature point extraction unit, with the masking picture generated by said masking picture generation unit, so as not to be influenced by an object in a near view or a natural object in a distant view; a calculation unit configured to calculate a positional relationship between the first picture and the second picture based on the feature point specified from the feature points as a result of the masking by said feature point masking unit and the extracted feature points of the second picture; and a picture correction unit configured to correct one of the first picture and the second picture based on the positional relationship calculated by said calculation unit, characterized in that said masking picture generation unit is configured to (i) determine a first region including first pixels which are pixels each having a peak angle of an angle histogram generated based on angle information calculated based on the edges in the first picture, (ii) determine a second region obtained by expanding the first region by making use of the angle information, and (iii) generate the masking picture masking the second region.