Repository navigation
Fix rgb2gray docstring to show that 2-D arrays are allowed as inputs - #4417
parekhnish wants to merge 2 commits into
Conversation
rfezzani
left a comment
There was a problem hiding this comment.
Thank you @parekhnish for this contribution! You can see in my #3200 (comment) that the problem is heavier then expected.
I think that as long as we don't find an acceptable solution to the discussion #3200, we have to add mention in the Notes that channels with indices greater then 3 are ignored
| The image in RGB format, in a 3-D or 4-D array of shape | ||
| ``(.., ..,[ ..,] 3)``, or in RGBA format with shape | ||
| ``(.., ..,[ ..,] 4)``. | ||
| ``(.., ..,[ ..,] 4)`` |
There was a problem hiding this comment.
We have to remove the mention to arrays of shape (.., ..,[ ..,] 4) since _prepare_colorarray doesn't accept RGBA images.
| ValueError | ||
| If `rgb2gray` is not a 3-D or 4-D arrays of shape | ||
| If `rgb` is a 1-D array, or not a 3-D or 4-D array of shape | ||
| ``(.., ..,[ ..,] 3)`` or ``(.., ..,[ ..,] 4)``. |
There was a problem hiding this comment.
Same as above, RGBA images are not supported...
| ``(.., ..,[ ..,] 3)``, or in RGBA format with shape | ||
| ``(.., ..,[ ..,] 4)``. | ||
| ``(.., ..,[ ..,] 4)`` | ||
| or |
There was a problem hiding this comment.
This can simply be added in the Notes section, what do you think?
|
|
||
| If there is an alpha channel present, it is ignored. | ||
|
|
||
| If the input array is 2-D, it is converted to a row-major (i.e. C-style) |
There was a problem hiding this comment.
I would be fine adding al lthe comments in the Notes section stating that calling this function with 2D images, while supported for now, is heavily discouraged.
|
@parekhnish thanks for your effort! The solution has been discussed in #3200 and implemented in #4438. |
Description
This is a docstring fix, refers to discussion in #3200, specifically this reply.
rgb2gray()allows 2-D arrays as inputs, but the docstring stated it would raise aValueError. This PR does the following:For reviewers
later.
__init__.py.doc/release/release_dev.rst.@meeseeksdev backport to v0.14.x