The present disclosure discloses a method of generating a random coded pattern for coding structured light. According to the method, under a certain distribution rule, coding primitives are added one by one using a random probability distribution map, thereby generating a random coded pattern satisfying a distribution requirement of window uniqueness; the random coded pattern may be used independently as a structured light encoded pattern or may be spliced and expanded from basic image elements as the structured light coded pattern. The structured light coded pattern obtained from the method is projected by a projecting device according to a certain field of angle, which may perform spatial coding and feature calibration to the three-dimensional space or a target object, for depth identification. The present disclosure also discloses an apparatus for generating a random coded pattern for coding structured light. The random coded pattern generated by the method or apparatus of the present disclosure has a high randomness and supports a plurality of coding primitives of different shape sizes, such that the identification issues of monocular, binocular or multi-view matching during a depth decoding process may be solved.
METHOD AND APPARATUS FOR GENERATING A RANDOM CODING PATTERN FOR CODING STRUCTURED LIGHT