A three-dimensional shape measurement apparatus comprising: a plurality of pattern illumination parts for obliquely illuminating grating pattern light in different directions toward a measurement target; a plurality of main image-capturing parts for obtaining a grating pattern image of the measurement target by receiving reflection light of the grating pattern light that is illuminated from the pattern illumination parts to the measurement target and obliquely reflected by the measurement target; and further comprising an illumination part for illuminating light toward the measurement target, wherein the plurality of main image-capturing parts obtain a plane image of the measurement target by receiving reflection light of the light that is illuminated from the illumination part to the measurement target and reflected by the measurement target; a control part for producing height data of the measurement target by selectively applying a first method of an optical triangulation method in which the height data of the measurement target is produced by using grating pattern images of the measurement target, a second method of a stereo measurement method in which the height data of the measurement target is produced by using image positions of plane images for the measurement target and texture information of the measurement target, and a third method of a stereo measurement method in which the height data of the measurement target is produced by utilizing grating pattern illuminated on the measurement target as the texture information of the measurement target, characterized by the fact that the control part is configured to produce height data of the measurement target in plurality for any one point by both the optical triangulation method according to the first method and the stereo measurement method according to the second method or the third method, and the control part is configured to selectively use only one of the plural height data for the one point, wherein the control part is configured to select images or image pixels with high reliability among said grating pattern images captured by the main image-capturing parts, and combine the selected images or image pixels to obtain said height data, wherein the reliability includes a relative position information between each main image capturing part and each pattern illumination part. a plurality of pattern illumination parts for obliquely illuminating grating pattern light in different directions toward a measurement target; a plurality of main image-capturing parts for obtaining a grating pattern image of the measurement target by receiving reflection light of the grating pattern light that is illuminated from the pattern illumination parts to the measurement target and obliquely reflected by the measurement target; and further comprising an illumination part for illuminating light toward the measurement target, wherein the plurality of main image-capturing parts obtain a plane image of the measurement target by receiving reflection light of the light that is illuminated from the illumination part to the measurement target and reflected by the measurement target; a control part for producing height data of the measurement target by selectively applying a first method of an optical triangulation method in which the height data of the measurement target is produced by using grating pattern images of the measurement target, a second method of a stereo measurement method in which the height data of the measurement target is produced by using image positions of plane images for the measurement target and texture information of the measurement target, and a third method of a stereo measurement method in which the height data of the measurement target is produced by utilizing grating pattern illuminated on the measurement target as the texture information of the measurement target, characterized by the fact that the control part is configured to produce height data of the measurement target in plurality for any one point by both the optical triangulation method according to the first method and the stereo measurement method according to the second method or the third method, and the control part is configured to selectively use only one of the plural height data for the one point, wherein the control part is configured to select images or image pixels with high reliability among said grating pattern images captured by the main image-capturing parts, and combine the selected images or image pixels to obtain said height data, wherein the reliability includes a relative position information between each main image capturing part and each pattern illumination part.