Skip to content

Commit dd9f467

Browse files
committed
fixed
1 parent c8097b6 commit dd9f467

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Question_01_10/answer_9.jpg

-199 Bytes
Loading

Question_01_10/answer_9.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@
1818
## Kernel
1919
K = np.zeros((K_size, K_size), dtype=np.float)
2020
for x in range(-pad, -pad+K_size):
21+
2122
for y in range(-pad, -pad+K_size):
2223
K[y+pad, x+pad] = np.exp( -(x**2 + y**2) / (2* (sigma**2)))
2324
K /= (sigma * np.sqrt(2 * np.pi))
2425
K /= K.sum()
2526

27+
tmp = out.copy()
28+
2629
for y in range(H):
2730
for x in range(W):
2831
for c in range(C):
29-
out[pad+y, pad+x, c] = np.sum(K * out[y:y+K_size, x:x+K_size, c])
32+
out[pad+y, pad+x, c] = np.sum(K * tmp[y:y+K_size, x:x+K_size, c])
3033

3134
out = out[pad:pad+H, pad:pad+W].astype(np.uint8)
3235

0 commit comments

Comments
 (0)