Intensity variation function and template matching-based pedestrian tracking in infrared imagery with occlusion detection and recovery