Skip to content

Crash when upsampling using 'box' mode? #1

@noamgat

Description

@noamgat

The following code generates an exception:
test_im = np.zeros((29,25,4))
imresize(test_im, output_shape=(40, 40, 4), kernel='box')

Traceback (most recent call last):
File "C:/Users/Noam/AppData/Roaming/JetBrains/PyCharm2020.1/scratches/scratch_1.py", line 232, in
imresize(test_im, output_shape=(40, 40, 4), kernel='box')
File "C:/Users/Noam/AppData/Roaming/JetBrains/PyCharm2020.1/scratches/scratch_1.py", line 43, in imresize
out_im = resize_along_dim(out_im, dim, weights, field_of_view)
File "C:/Users/Noam/AppData/Roaming/JetBrains/PyCharm2020.1/scratches/scratch_1.py", line 151, in resize_along_dim
tmp_out_im = np.sum(tmp_im[field_of_view.T] * weights, axis=0)
IndexError: index 4 is out of bounds for axis 0 with size 4
Process finished with exit code 1

Is this expected behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions