1. A method for performing optical flow on a depth map comprising a selected point and a second point, each point indicating a depth value, the method comprising: determining region comprising the selected and second points; processing the region by assigning a grayscale value to each point as a function of each point's associated depth value; processing the region using an optical flow algorithm to determine optical flow vectors for the region; performing a velocity prediction of the selected point; analyzing the region to determine an amount of occlusion of the region; determining a new location for the selected point based on a weighting of the optical flow vectors for the region and the velocity prediction, the weighting being based on the determined amount of occlusion in the region such that a relative weight given to the velocity prediction and a relative weight given to the optical flow vectors depends on the determined amount of occlusion, and the weight given to the velocity prediction is increased relative to the weight given to the optical flow vectors as the determined amount of occlusion increases; and setting the location of the selected point to the new location.