In order to make up for the shortcomings of the traditional inspection methods of rivet unevenness in precision, efficiency and stability, a new inspection method is proposed based on structured light and binocular vision. First, the structured light is projected onto the surface by an industrial projector, and then the ojection image is captured by a binocular camera. Then the riveted area is extracted according to the edge, and the phase information of the area is calculated with the improved Gray code phase unwrapping. Feature points are matched based on phase information and point clouds are calculated according to the principle of disparity. Finally, the rivet unevenness is calculated by processing point data. The experimental results indicate that the absolute error is within ± 20 μm with repeatability less than 3 μm. The measurement time for a single rivet is approximately 2.2 s. Requirements for on-site measurement accuracy and efficiency can be met.