1. A method of reducing depth error for a TOF system providing emitted optical energy toward a target object using an array of pixels to detect at least a portion of reflected optical energy, and determining a distance to said target object by comparing a phase of the emitted optical energy with a phase of the reflected optical energy detected, the method comprising: (a) determining how to combine values of the reflected optical energy detected in time or space from pixels included in the array of pixels to yield depth data using one or both of a temporal model and a spatial model; and (b) determining how to compensate for individual pixel offsets to yield the depth data.