1. A three-dimensional-shape measurement apparatus comprising: a first acquisition unit configured to acquire a first captured image of a space onto which a first light pattern formed from a bright portion and a dark portion has been projected; a second acquisition unit configured to acquire a second captured image of the space onto which has been projected a second light pattern formed from a bright portion and a dark portion and having a boundary position between the bright portion and the dark portion that is different from that of the first pattern; a selection unit configured to select, for each of at least one predetermined region of the first captured image or the second captured image, based on a luminance value in the first captured image and a luminance value in the second captured image, one of the first captured image and the second captured image containing the at least one predetermined region as a selection image to be used for three-dimensional-shape measurement; and a measurement unit configured to perform three-dimensional-shape measurement of an object included in the space based on the selection image selected by said selection unit.