An information processing apparatus comprising: a pattern generation means arranged to generate pattern data including a plurality of measurement lines, and a reference line which has a plurality of intersection points (41,42) with the plurality of measurement lines, respectively, and has a shape that is defined in an interval between the intersection points (41, 42) by a specific feature; an image capturing means arranged to capture an image of an object onto which projection pattern light, based on the pattern data generated by said pattern generation means, is projected; an intersection extraction means arranged to extract the intersection points (41, 42) from the image captured by said image capturing means; an information obtaining means arranged to obtain information, concerning the presence or absence of the specific feature in the interval between each pair of adjacent intersection points (41, 42) on the reference line in the captured image, as identification information used to identify each measurement line in the plurality of measurement lines: an associating means arranged to associate the reference line in the pattern data and the reference line in the captured image with each other, based on the identification information obtained by said information obtaining means, and associate the measurement lines in the pattern data and the measurement lines in the captured image with each other based on the result of the association; and a shape calculation means arranged to calculate the three-dimensional shape of the object, based on the positional relationship between a projection means arranged to project the projection pattern light and the image capturing means arranged to capture the image of the object onto which the projection pattern light is projected, and an association relationship between the measurement lines in the projection pattern light and the measurement lines in the captured image. a pattern generation means arranged to generate pattern data including a plurality of measurement lines, and a reference line which has a plurality of intersection points (41,42) with the plurality of measurement lines, respectively, and has a shape that is defined in an interval between the intersection points (41, 42) by a specific feature; an image capturing means arranged to capture an image of an object onto which projection pattern light, based on the pattern data generated by said pattern generation means, is projected; an intersection extraction means arranged to extract the intersection points (41, 42) from the image captured by said image capturing means; an information obtaining means arranged to obtain information, concerning the presence or absence of the specific feature in the interval between each pair of adjacent intersection points (41, 42) on the reference line in the captured image, as identification information used to identify each measurement line in the plurality of measurement lines: an associating means arranged to associate the reference line in the pattern data and the reference line in the captured image with each other, based on the identification information obtained by said information obtaining means, and associate the measurement lines in the pattern data and the measurement lines in the captured image with each other based on the result of the association; and a shape calculation means arranged to calculate the three-dimensional shape of the object, based on the positional relationship between a projection means arranged to project the projection pattern light and the image capturing means arranged to capture the image of the object onto which the projection pattern light is projected, and an association relationship between the measurement lines in the projection pattern light and the measurement lines in the captured image. an associating means arranged to associate the reference line in the pattern data and the reference line in the captured image with each other, based on the identification information obtained by said information obtaining means, and associate the measurement lines in the pattern data and the measurement lines in the captured image with each other based on the result of the association; and a shape calculation means arranged to calculate the three-dimensional shape of the object, based on the positional relationship between a projection means arranged to project the projection pattern light and the image capturing means arranged to capture the image of the object onto which the projection pattern light is projected, and an association relationship between the measurement lines in the projection pattern light and the measurement lines in the captured image.