Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    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)
Пример #4
0
    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)