A structured-light projector successively comprising: - a light source configured to emit a beam with a continuous spectrum between a minimum wavelength (λmin) and a maximum wavelength (λmax), - an optical system for spectral decomposition, configured to capture the spectrum of the beam emitted by the source and to spectrally decompose it with an image of the beam at the minimum wavelength (λmin) juxtaposed with an image of the beam at the maximum wavelength (λmax) in at least one predetermined plane that is transverse to an optical path of the beam and along a line of that plane constituting a boundary, - an encoding device configured to encode the spectrally decomposed spectrum. the encoding device comprising a mask (51, 90), the mask (51, 90) being positioned in the predetermined plane, and th e mask (51, 90) comprising a binary encoding matrix pattern formed from a series of 2*n rows and a series of m columns, wherein "n" is equal to or greater than 4, and wherein "m" is equal to or greater than 16, a demarcation between the rows "n" and "n+1" being superposed on said boundary, a sub-pattern defined by the rows "1" to "n" being illuminated by the image of the beam with the wavelength λmin and a sub-pattern defined by the rows "n+1" to "2*n" being illuminated by the image of the beam with the wavelength λmax, the sub-pattern defined by the rows "1" to "n" being identical to or complementary with the sub-pattern defined by the rows "n+1" to "2*n", and a sub-pattern defined by the rows "i" to "i+n-1", i being comprised between 2 and n, being illuminated by an image of the beam with a given wavelength λ comprised between λmin and λmax, the m columns being perpendicular to that demarcation and two neighboring columns each comprising a different binary encoding from the other, - an optical system for spectral recombination configured to recombine the spectrally decomposed and encoded spectrum into a recombined beam, and - an optical projection system configured to project the recombined beam onto a scene to observe. - a light source configured to emit a beam with a continuous spectrum between a minimum wavelength (λmin) and a maximum wavelength (λmax), - an optical system for spectral decomposition, configured to capture the spectrum of the beam emitted by the source and to spectrally decompose it with an image of the beam at the minimum wavelength (λmin) juxtaposed with an image of the beam at the maximum wavelength (λmax) in at least one predetermined plane that is transverse to an optical path of the beam and along a line of that plane constituting a boundary, - an encoding device configured to encode the spectrally decomposed spectrum. the encoding device comprising a mask (51, 90), the mask (51, 90) being positioned in the predetermined plane, and th e mask (51, 90) comprising a binary encoding matrix pattern formed from a series of 2*n rows and a series of m columns, wherein "n" is equal to or greater than 4, and wherein "m" is equal to or greater than 16, a demarcation between the rows "n" and "n+1" being superposed on said boundary, a sub-pattern defined by the rows "1" to "n" being illuminated by the image of the beam with the wavelength λmin and a sub-pattern defined by the rows "n+1" to "2*n" being illuminated by the image of the beam with the wavelength λmax, the sub-pattern defined by the rows "1" to "n" being identical to or complementary with the sub-pattern defined by the rows "n+1" to "2*n", and a sub-pattern defined by the rows "i" to "i+n-1", i being comprised between 2 and n, being illuminated by an image of the beam with a given wavelength λ comprised between λmin and λmax, the m columns being perpendicular to that demarcation and two neighboring columns each comprising a different binary encoding from the other, - an optical system for spectral recombination configured to recombine the spectrally decomposed and encoded spectrum into a recombined beam, and - an optical projection system configured to project the recombined beam onto a scene to observe.