Skip to content

Commit

Permalink
Merge pull request gzr2017#12 from kokosabu/q10_fix
Browse files Browse the repository at this point in the history
fixed
  • Loading branch information
yoyoyo-yo authored Feb 25, 2019
2 parents fd65761 + 9c4f727 commit dd04031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Binary file modified Question_01_10/answer_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Question_01_10/answer_10.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
out = np.zeros((H + pad*2, W + pad*2, C), dtype=np.float)
out[pad:pad+H, pad:pad+W] = img.copy().astype(np.float)

tmp = out.copy()

for y in range(H):
for x in range(W):
for c in range(C):
out[pad+y, pad+x, c] = np.median(out[y:y+K_size, x:x+K_size, c])
out[pad+y, pad+x, c] = np.median(tmp[y:y+K_size, x:x+K_size, c])

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

Expand Down

0 comments on commit dd04031

Please sign in to comment.