Deformation is calculated by dividing the images into 8x8 grid of cells and computing the sum of squared differences of averaged pixel intensity over the cells in current and first frame.
Input:
Output:
mean_val : mean value of the deformation of the object for the sequence
val_val : variance of the deformation of the object for the sequence
frames : the deformation of the object for each frame