def drawglobalmask(self, global_mask): x, y, w, h = self.bound_rect global_mask[y:y + h, x:x + w] = cv2.add(global_mask[y:y + h, x:x + w], self.mask) return global_mask
def drawglobalmask(self, global_mask): x, y, w, h = self.bound_rect global_mask[y:y + h, x:x + w] = cv2.add( global_mask[y:y + h, x:x + w], self.mask) return global_mask
def drawmask(self, frame): # Create colored mask for visualization x, y, w, h = self.bound_rect mask_color = np.zeros((h, w, 3), dtype=np.uint8) mask_color[:, :, 1] = 255 # Assign blue color to created colored mask mask_color = cv2.bitwise_and(mask_color, mask_color, mask=self.mask) frame[y:y + h, x:x + w] = cv2.add(frame[y:y + h, x:x + w], mask_color)