An apparatus comprising: an illumination source configured to: modulate a structured light pattern by a carrier signal so an intensity of the structured light pattern varies over time based on the carrier signal , and emit the modulated structured light pattern; an imaging device configured to capture the modulated structured light pattern, the imaging device including a detector ; the detector comprising a plurality of pixel groups each including one or more pixels, each pixel group including multiple charge storage regions, with the detector being configured to accumulate charge from light captured by a pixel group in one of the charge storage regions included in the pixel group based on a frequency and a phase of the carrier signal; characterized in that the apparatus further comprises: a processor coupled to the imaging device , the processor configured to: determine a phase of the carrier signal based on intensities of light received by different pixel groups in the detector , determine a time for the modulated pattern of structured light to be reflected from one or more objects in the local area and captured by the detector based on the determined phase of the carrier signal, determine distances from the detector to one or more objects in the local area from the determined times, and generate a frame including the pattern of structured light from the light captured by each pixel group in the detector at different times. modulate a structured light pattern by a carrier signal so an intensity of the structured light pattern varies over time based on the carrier signal , and emit the modulated structured light pattern; an imaging device configured to capture the modulated structured light pattern, the imaging device including a detector ; the detector comprising a plurality of pixel groups each including one or more pixels, each pixel group including multiple charge storage regions, with the detector being configured to accumulate charge from light captured by a pixel group in one of the charge storage regions included in the pixel group based on a frequency and a phase of the carrier signal; characterized in that the apparatus further comprises: a processor coupled to the imaging device , the processor configured to: determine a phase of the carrier signal based on intensities of light received by different pixel groups in the detector , determine a time for the modulated pattern of structured light to be reflected from one or more objects in the local area and captured by the detector based on the determined phase of the carrier signal, determine distances from the detector to one or more objects in the local area from the determined times, and generate a frame including the pattern of structured light from the light captured by each pixel group in the detector at different times. determine a phase of the carrier signal based on intensities of light received by different pixel groups in the detector , determine a time for the modulated pattern of structured light to be reflected from one or more objects in the local area and captured by the detector based on the determined phase of the carrier signal, determine distances from the detector to one or more objects in the local area from the determined times, and generate a frame including the pattern of structured light from the light captured by each pixel group in the detector at different times. <EOS>