Using gradient based motion estimation is good at detecting sub-pixel shifts. During an investigation on depth of defocus, this software was developed for compensating the misalignment of a focus-drive.