The invention discloses a three-dimensional
reconstruction method based on coding
structured light, comprising the following steps: 1) projecting
structured light to an object to be measured, and capturing an image modulated by the object to be measured by a camera; 2) matching an optical template, comprising: (2.1) positioning the optical strip boundary, scanning along each row of the image, determining a pixel point with strong gray variation as a candidate marginal point, and searching a
local domain; and (2.2) matching the optical strip: adopting a color cluster method to build a
color matching proper vector, comparing image color with a projected color, and defining
Euclidean distance between the color proper vector and the cluster center to distribute the colors of red, green, blue and white of the candidate optical strip; and 3) using a calibrated
system parameter for three-dimensional reconstruction of the object to be measured, determining the relation between a space point coordinate and the image coordinate point thereof by the calibrated conversion matrix parameter; and restoring three-dimensional spatial coordinate from the image coordinate of a feature point. The invention can simplify calculation process and has high matching precision and high reconstruction precision.