def draw_brain_frame(self, background, side): brain = self.brain_animation.next() if side == 'L': brain = cv2.flip(brain, 1) brain = cv2.resize(brain, (self.score_cell.width, self.score_cell.height)) overlay_transparent(background, brain, (self.score_cell.left, self.score_cell.top))
def overlay_object_detection_animation(self, frame, animation_frame): if animation_frame is not None: pos = self.obj_detect_animator.animation_rect.get_pos() overlay_transparent(frame, animation_frame, pos) frame = draw_text_in_pos(frame, self.obj_detect_animator.label, self.FONT, (pos[0], pos[1] - 30)) return frame
def overlay_panels(self, frame, reverse, sex): l_panel_fragment = frame[self.y:self.y + self.l_panel.background.shape[0], self.lp_x:self.lp_x + self.l_panel.background.shape[1]] r_panel_fragment = frame[self.y:self.y + self.r_panel.background.shape[0], self.rp_x:self.rp_x + self.r_panel.background.shape[1]] if not reverse: l_frame = self.l_panel.update_UI(l_panel_fragment, side='L') r_frame = self.r_panel.update_UI(r_panel_fragment, side='R') else: r_frame = self.l_panel.update_UI(r_panel_fragment, side='R') l_frame = self.r_panel.update_UI(l_panel_fragment, side='L') overlay_transparent(frame, l_frame, (self.lp_x, self.y)) overlay_transparent(frame, r_frame, (self.rp_x, self.y)) # if 'M' in sex: # overlay_transparent(frame, self.male_frame, (0, 0)) # elif 'F' in sex: # overlay_transparent(frame, self.female_frame, (0, 0)) return frame
def overlay_face_detection_bound(self, frame): if self.face_detection_bound_animator and not self.face_detection_bound_animator.is_over( ): face_detection_bound_frame = self.face_detection_bound_animator.next( ) overlay_transparent(frame, face_detection_bound_frame, self.face_position) return frame
def overlay_face_animation(self, frame): if not self.animation_data: return frame scaled_bitmap, new_pos = self.animation_data.get_new_located_bitmap() overlay_transparent(frame, scaled_bitmap, (new_pos.x, new_pos.y)) if not self.animation_data.steps_left(): self.scanned_female_avatar = scaled_bitmap self.l_panel.photo = self.scanned_female_avatar self.animation_data = None return frame
def draw_icons(self, background): for cell in self.cells: background = overlay_transparent(background, cell.pict, cell.pict_pos)
def draw_circles(self, background): for cell in self.cells: background = overlay_transparent(background, cell.circle.figure, cell.circle_pos)
def overlay_brain_back(self, background, side): brain_back = self.brain_back if side == 'L': brain_back = cv2.flip(self.brain_back, 1) brain_back = cv2.resize(brain_back, (self.score_cell.width, self.score_cell.height)) overlay_transparent(background, brain_back, (self.score_cell.left, self.score_cell.top))
def draw_photo(self, background): if self.is_chatter_not_detected() or self.photo is None: return overlay_transparent(background, self.photo, (self.photo_cell.left, self.photo_cell.top))