1. A measurement apparatus for measuring a three-dimensional shape of an object using a plurality of space encoding patterns each of which includes a light portion and a dark portion, the measurement apparatus comprising: one or more processors; and at least one memory coupled to the one or more processors, the at least one memory having instructions stored thereon which, when executed by the one or more processors cause the measurement apparatus to: obtain a first pattern set comprising patterns each of which has the light portion of each space encoding pattern masked by a checkerboard pattern mask, and a second pattern set comprising patterns each of which has the light portion of each of the space encoding pattern masked by a mask with varying the checkerboard pattern mask, input, from a capturing device, captured images of an object to be measured on which the patterns of the first and second pattern sets are sequentially projected by a projection device, detect a correspondence between projection coordinates of the projected pattern and image coordinates of a captured image for the projected pattern, and derive a three-dimensional shape of the object to be measured based on detected correspondences.