def CT_run(self, img, img_old):
""" CT_run:
-------
When called, it will // CT.update // the Correlation Tracker once.
if self.UPDATED, it will call // CT.start_track //.
"""
if self.UPDATED:
self.UPDATED = False # Ok, now updated
self.CT.start_track(img_old, dlib.rectangle(*self.CT_box_update))
self._CT_turn_new_to_old() # turn new to old
self.CT.update(img)
# get current position and update // CT_box //
rect = self.CT.get_position()
self.CT_box = [int(rect.left()), int(rect.top()), \
int(rect.right()), int(rect.bottom())]
# if self.UPDATED:
评论列表
文章目录