Structured light coding method and related device

The invention discloses a structured light coding method and a related device. The structured light coding method includes the first step of generating a first coding pattern through a pseudo-random code, wherein coding elements in the first coding pattern are distinguished through at least color graphs in four colors and at least one geometric graph, the second step of projecting the first coding pattern onto the surface of a measured object, the third step of obtaining a second coding pattern formed after the first coding pattern and the surface of the measured object are overlapped, the fourth step of determining a feature point set on the second coding pattern, the fifth step of determining the corresponding position of each feature point in the feature point set in the first coding pattern, and the sixth step of calculating the depth of each feature point in the feature point set in the second coding pattern according to the position of each feature point in the feature point set in the first coding pattern and finally determining three-dimensional contour information of the measured object. Through the technical scheme of the method, on the premise that the coding density is ensured, the success rate of decoding is effectively increased.