Calculates displacement from one line of images using Cython