def __get_movement_zones(self, f): boxes = [] if len(self.bg_frames) >= self.bg_history / 2: boxes = scan(f, self.expansion_step) if self.group_boxes: boxes = optimize_bounding_boxes(boxes) self.detection_boxed = self.detection.copy() for b in boxes: cv2.rectangle(self.detection_boxed, (b[0], b[1]), (b[2], b[3]), 250, 1) orig_boxes = [] for b in boxes: orig_boxes.append(numba_scale_box(b, self.pixel_compression_ratio)) self.boxes = orig_boxes return orig_boxes
def __get_movement_zones(self, f): boxes = [] # wait until the bg gets established to decrease the level of initial unstable noise if len(self.bg_frames) >= self.bg_history / 2: boxes = scan(f, self.expansion_step) if self.group_boxes: boxes = optimize_bounding_boxes(boxes) self.detection_boxed = self.detection.copy() for b in boxes: cv2.rectangle(self.detection_boxed, (b[0], b[1]), (b[2], b[3]), 250, 1) orig_boxes = [] for b in boxes: orig_boxes.append(numba_scale_box(b, self.pixel_compression_ratio)) self.boxes = orig_boxes return orig_boxes