From 860eb399ef24a64be914e4edeeb7695e0f5f1c1e Mon Sep 17 00:00:00 2001 From: AbdealiJK Date: Thu, 23 Jun 2016 09:25:51 +0530 Subject: [PATCH] color.colorconv: Fix documentation of rgb2gray() The working of rgb2gray() has been modified, and it now works with both 3D and 4D arrays and appropriately finds the luminance image of the given image. The documnetation does not mention the 4D array support and this commit modifies the documentation to mention this. --- skimage/color/colorconv.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/skimage/color/colorconv.py b/skimage/color/colorconv.py index 08cd1775..e8dd4224 100644 --- a/skimage/color/colorconv.py +++ b/skimage/color/colorconv.py @@ -694,19 +694,21 @@ def rgb2gray(rgb): Parameters ---------- rgb : array_like - The image in RGB format, in a 3-D array of shape ``(.., .., 3)``, - or in RGBA format with shape ``(.., .., 4)``. + The image in RGB format, in a 3-D or 4-D array of shape + ``(.., ..,[ ..,] 3)``, or in RGBA format with shape + ``(.., ..,[ ..,] 4)``. Returns ------- out : ndarray - The luminance image, a 2-D array. + The luminance image - an array which is the same size as the input + array, but with the channel dimension removed. Raises ------ ValueError - If `rgb2gray` is not a 3-D array of shape ``(.., .., 3)`` or - ``(.., .., 4)``. + If `rgb2gray` is not a 3-D or 4-D arrays of shape + ``(.., ..,[ ..,] 3)`` or ``(.., ..,[ ..,] 4)``. References ----------