mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-29 19:32:47 +08:00
ea1566fffb
`np.atleast_3d` will add a singleton dimension at the end of an array if needed. This is not the correct thing to do if `multichannel=False` based on the subsequent lines. If the input image was 2D with shape `(40, 50)` and `multichannel=False`, then `np.atleast_3d` gives it shape `(40, 50, 1)`, and then, because `multichannel=False`, the rest of the code gives it shape `(40, 50, 1, 1)`. This results in the final returned array having shape `(40, 50, 1)` instead of the desired `(40, 50)`. This commit fixes that and updates the test to detect this failure.