File size: 706 Bytes
8804c8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import numpy as np
from PIL import Image
from scipy.ndimage.filters import gaussian_filter
import cv2 
import numpy as np
from scipy.ndimage import gaussian_filter
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon



# 1ν”„λ‘œμ—μ„œ 5ν”„λ‘œμ‚¬μ΄μ˜ crop λœλΆ€λΆ„λ§Œ 전체 λ§ˆμŠ€ν‚Ήν•˜λŠ” μ½”λ“œμž…λ‹ˆλ‹€. 
def mosaik(img,bboxes):
    for box in bboxes:
        #[y_min,y_max,x_min,x_max]) #
        
        cropped=img[box[0]:box[1],box[2]:box[3],:]
        
    
        cropped=np.array(cropped)
        cropped = gaussian_filter(cropped, sigma=16)
        img[box[0]:box[1],box[2]:box[3],:]=cropped


    return img