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 (400, 405); the detector (400, 405) comprising a plurality of pixel groups (410, 415, 420, 425) each including one or more pixels, each pixel group (410, 415, 420, 425) including multiple charge storage regions, with the detector (400, 405) being configured to accumulate charge from light captured by a pixel group (410, 415, 420, 425) in one of the charge storage regions included in the pixel group (410, 415, 420, 425) 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 (410, 415, 420, 425) in the detector (400, 405), 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 (400, 405) based on the determined phase of the carrier signal, determine distances from the detector (400, 405) 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 (410, 415, 420, 425) in the detector (400, 405) 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 (400, 405); the detector (400, 405) comprising a plurality of pixel groups (410, 415, 420, 425) each including one or more pixels, each pixel group (410, 415, 420, 425) including multiple charge storage regions, with the detector (400, 405) being configured to accumulate charge from light captured by a pixel group (410, 415, 420, 425) in one of the charge storage regions included in the pixel group (410, 415, 420, 425) 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 (410, 415, 420, 425) in the detector (400, 405), 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 (400, 405) based on the determined phase of the carrier signal, determine distances from the detector (400, 405) 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 (410, 415, 420, 425) in the detector (400, 405) at different times. determine a phase of the carrier signal based on intensities of light received by different pixel groups (410, 415, 420, 425) in the detector (400, 405), 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 (400, 405) based on the determined phase of the carrier signal, determine distances from the detector (400, 405) 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 (410, 415, 420, 425) in the detector (400, 405) at different times.