@@ -48,7 +48,7 @@ def update(frame):
48
48
- Update blurred image frame
49
49
"""
50
50
pbar .update (1 )
51
- row = (frame % total_frames ) // (img_pad .shape [1 ] - kernel_size + 1 )
51
+ row = (frame % total_frames ) // (img_pad .shape [0 ] - kernel_size + 1 )
52
52
col = (frame % total_frames ) % (img_pad .shape [1 ] - kernel_size + 1 )
53
53
54
54
k_rect .set_x (col - 0.5 )
@@ -93,7 +93,7 @@ def update(frame):
93
93
# precompute animation frames and append to the list
94
94
total_frames = (img_pad .shape [0 ] - kernel_size + 1 ) * (img_pad .shape [1 ] - kernel_size + 1 ) # total frames if by change image is not squared
95
95
for frame in range (total_frames ):
96
- row = (frame % total_frames ) // (img_pad .shape [1 ] - kernel_size + 1 ) # row index
96
+ row = (frame % total_frames ) // (img_pad .shape [0 ] - kernel_size + 1 ) # row index
97
97
col = (frame % total_frames ) % (img_pad .shape [1 ] - kernel_size + 1 ) # col index
98
98
img_chunk = img_pad [row : row + kernel_size , col : col + kernel_size ] # get current image chunk inside the kernel
99
99
new_img [row , col ] = np .mean (img_chunk ).astype (np .uint16 ) # calculate its mean -> mean filter
@@ -121,7 +121,7 @@ def update(frame):
121
121
# Fix limits to the right image (without padding) is the same size as the left image (with padding)
122
122
ax2 .set (
123
123
ylim = ((img_pad .shape [0 ] - kernel_size / 2 ), - kernel_size / 2 ),
124
- xlim = (- kernel_size / 2 , (img_pad .shape [0 ] - kernel_size / 2 ))
124
+ xlim = (- kernel_size / 2 , (img_pad .shape [1 ] - kernel_size / 2 ))
125
125
)
126
126
127
127
# We don't need to see the ticks
0 commit comments