Improving robustness of infrared target tracking algorithms based on template matching