A method for controlling a structured light projector, comprising: acquiring a depth image and an initial visible light image of a scene, wherein the depth image is obtained by projecting a first laser pattern to the scene at an initial light emission power with the structured light projector; determining whether a face exists in the initial visible light image; calculating, responsive to determining that the face exists in the initial visible light image, a distance between the face and the structured light projector based on the initial visible light image and the depth image; and adjusting light emission power of the structured light projector based on the distance, characterized in that the initial visible light image has a first resolution, the depth image has a third resolution, and wherein calculating the distance between the face and the structured light projector based on the initial visible light image and the depth image comprises: converting the initial visible light image into an intermediate visible light image with a second resolution, wherein the first resolution is higher than the second resolution; recognizing a visible light face detection region from the intermediate visible light image; acquiring from the depth image, a depth face detection region corresponding to the visible light face detection region according to a mapping relationship between the intermediate visible light image and the depth image; and selecting depth data with a minimum value in the depth face detection region as the distance between the face and the structured light projector. acquiring a depth image and an initial visible light image of a scene, wherein the depth image is obtained by projecting a first laser pattern to the scene at an initial light emission power with the structured light projector; determining whether a face exists in the initial visible light image; calculating, responsive to determining that the face exists in the initial visible light image, a distance between the face and the structured light projector based on the initial visible light image and the depth image; and adjusting light emission power of the structured light projector based on the distance, characterized in that the initial visible light image has a first resolution, the depth image has a third resolution, and wherein calculating the distance between the face and the structured light projector based on the initial visible light image and the depth image comprises: converting the initial visible light image into an intermediate visible light image with a second resolution, wherein the first resolution is higher than the second resolution; recognizing a visible light face detection region from the intermediate visible light image; acquiring from the depth image, a depth face detection region corresponding to the visible light face detection region according to a mapping relationship between the intermediate visible light image and the depth image; and selecting depth data with a minimum value in the depth face detection region as the distance between the face and the structured light projector. converting the initial visible light image into an intermediate visible light image with a second resolution, wherein the first resolution is higher than the second resolution; recognizing a visible light face detection region from the intermediate visible light image; acquiring from the depth image, a depth face detection region corresponding to the visible light face detection region according to a mapping relationship between the intermediate visible light image and the depth image; and selecting depth data with a minimum value in the depth face detection region as the distance between the face and the structured light projector.