Image tracking algorithms in Matlab and C