6 parameter affine Lucas kanade and inverse decomposition completed. Code now runs much faster