1. A three-dimensional shape measuring device that measures a three-dimensional shape of a subject included in a captured image, the three-dimensional shape measuring device comprising a processor configured: to calculate, according to a position of the subject in the captured image, a coefficient that depends on a distance in a distance-dependent variable model from a light source to a measurement point of a luminance value according to a prescribed condition; to calculate the luminance value by using the coefficient; and to measure the three-dimensional shape of the subject according to the luminance value of the captured image and the coefficient, wherein in calculating the coefficient, the processor specifies a region of the subject in the captured image, and calculates a mean value of an index that corresponds to each pixel included in the region to be the coefficient.