1. A measuring apparatus comprising: a projection control unit configured to cause a projection unit to project, onto an object, a first light pattern with light and dark portions, a second light pattern, which is smaller in distance between the light and dark portions than that of the first light pattern and has a boundary position between the light and dark portions common to the first light pattern, and a third light pattern in which the light and dark portions of the second light pattern are reversed to each other; an acquisition unit configured to acquire a first captured image of the object onto which the first light pattern is projected, a second captured image of the object onto which the second light pattern is projected, and a third captured image of the object onto which the third light pattern is projected; and a calculation unit configured to calculate the boundary position between the light and dark portions of the first captured image based on the second and the third captured image to measure the position of the object.