Variational approach to optical flow estimation managing discontinuities