Minor changes to docs and formatting

This commit is contained in:
Alex Izvorski
2016-04-30 02:44:02 -07:00
parent 84c9254180
commit 1a6cff4f72
+32 -24
View File
@@ -1481,6 +1481,7 @@ def _prepare_lab_array(arr):
raise ValueError('Input array has less than 3 color channels')
return dtype.img_as_float(arr, force_copy=True)
def rgb2yuv(rgb):
"""RGB to YUV color space conversion.
@@ -1488,18 +1489,18 @@ def rgb2yuv(rgb):
----------
rgb : array_like
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in YUV format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `rgb` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `rgb` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
Notes
-----
@@ -1507,6 +1508,7 @@ def rgb2yuv(rgb):
"""
return _convert(yuv_from_rgb, rgb)
def rgb2yiq(rgb):
"""RGB to YIQ color space conversion.
@@ -1514,21 +1516,22 @@ def rgb2yiq(rgb):
----------
rgb : array_like
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in YIQ format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `rgb` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `rgb` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
"""
return _convert(yiq_from_rgb, rgb)
def rgb2ypbpr(rgb):
"""RGB to YIQ color space conversion.
@@ -1536,21 +1539,22 @@ def rgb2ypbpr(rgb):
----------
rgb : array_like
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in YIQ format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `rgb` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `rgb` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
"""
return _convert(ypbpr_from_rgb, rgb)
def rgb2ycbcr(rgb):
"""RGB to YCbCr color space conversion.
@@ -1558,18 +1562,18 @@ def rgb2ycbcr(rgb):
----------
rgb : array_like
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in YCbCr format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `rgb` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `rgb` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
Notes
-----
@@ -1581,6 +1585,7 @@ def rgb2ycbcr(rgb):
arr[..., 2] += 128
return arr
def yuv2rgb(yuv):
"""RGB to YIQ color space conversion.
@@ -1588,21 +1593,22 @@ def yuv2rgb(yuv):
----------
rgb : array_like
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in YIQ format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `rgb` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `rgb` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
"""
return _convert(rgb_from_yuv, yuv)
def yiq2rgb(yiq):
"""YIQ to RGB color space conversion.
@@ -1610,21 +1616,22 @@ def yiq2rgb(yiq):
----------
yiq : array_like
The image in YIQ format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `yiq` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `yiq` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
"""
return _convert(rgb_from_yiq, yiq)
def ypbpr2rgb(ypbpr):
"""YPbPr to RGB color space conversion.
@@ -1632,21 +1639,22 @@ def ypbpr2rgb(ypbpr):
----------
ypbpr : array_like
The image in YPbPr format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `ypbpr` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `ypbpr` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
"""
return _convert(rgb_from_ypbpr, ypbpr)
def ycbcr2rgb(ycbcr):
"""YCbCr to RGB color space conversion.
@@ -1654,18 +1662,18 @@ def ycbcr2rgb(ycbcr):
----------
ycbcr : array_like
The image in YCbCr format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Returns
-------
out : ndarray
The image in RGB format, in a 3- or 4-D array of shape
``(.., ..,[ ..,] 3)``.
``(M, N, [P,] 3)``.
Raises
------
ValueError
If `ycbcr` is not a 3- or 4-D array of shape ``(.., ..,[ ..,] 3)``.
If `ycbcr` is not a 3- or 4-D array of shape ``(M, N, [P,] 3)``.
Notes
-----