1. An image information processing apparatus that performs three-dimensional measurement of an object using a captured image obtained by projecting onto the object a projection pattern obtained by assigning, to each code in a projection code string in which a plurality of types of codes are two-dimensionally arranged, a symbol that differs from one type of code to another, the apparatus comprising: an obtaining unit configured to obtain an imaging pattern by extracting symbols from the captured image; a converting unit configured to convert each symbol in the imaging pattern obtained by the obtaining unit into a corresponding code to obtain an imaging code string; a generating unit configured to generate an information code string by obtaining a predetermined number of codes from the imaging code string according to a sampling pattern in which sampling positions of the predetermined number of codes and a sequence of the codes are defined and arranging the obtained codes; and a measuring unit configured to perform three-dimensional measurement of the object by determining correspondence between the information code string and the projection code string based on the information code string and the sampling pattern, wherein if it is not possible to obtain the predetermined number of codes from the imaging code string using the sampling pattern, the generating unit selects another sampling pattern to generate the information code string.