Introduction - If you have any usage issues, please Google them yourself
Use quaternion wavelet transform image flow estimation. Is the " Coherent Multiscale Image Processing using Dual-Tree Quaternion Wavelets" implementation. Code is very detailed.