Motion estimation with spatial constraints