Skip to content

Comments

Fix skimage match_histograms() deprecation: replace multichannel with channel_axis#387

Open
Mr-Neutr0n wants to merge 1 commit intodeforum:mainfrom
Mr-Neutr0n:fix/skimage-multichannel-deprecation
Open

Fix skimage match_histograms() deprecation: replace multichannel with channel_axis#387
Mr-Neutr0n wants to merge 1 commit intodeforum:mainfrom
Mr-Neutr0n:fix/skimage-multichannel-deprecation

Conversation

@Mr-Neutr0n
Copy link

Summary

  • Fixed TypeError: match_histograms() got an unexpected keyword argument 'multichannel'

Problem

In scikit-image 0.19+, the multichannel parameter was deprecated and removed in version 0.21. The error occurs when using newer versions of scikit-image.

Solution

Replaced multichannel=True with channel_axis=-1 (the new parameter name). The value -1 indicates that the channel dimension is the last axis, which is the same behavior as multichannel=True.

Related Issue

Fixes #381

Test Plan

  • Updated all 3 occurrences in helpers/colors.py
  • channel_axis=-1 is equivalent to multichannel=True for RGB/HSV/LAB images where channels are on the last axis

@Mr-Neutr0n
Copy link
Author

following up — skimage renamed the multichannel parameter to channel_axis in match_histograms(). this fixes the deprecation warning / error on newer scikit-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skimage unexpected 'multichannel' argument

1 participant