def imread(filename, *args, **kwargs):
    'Read and decode an image to an NDArray.\n\n    Note: `imread` uses OpenCV (not the CV2 Python library).\n    MXNet must have been built with USE_OPENCV=1 for `imdecode` to work.\n\n    Parameters\n    ----------\n    filename : str\n        Name of the image file to be loaded.\n    flag : {0, 1}, default 1\n        1 for three channel color output. 0 for grayscale output.\n    to_rgb : bool, default True\n        True for RGB formatted output (MXNet default).\n        False for BGR formatted output (OpenCV default).\n    out : NDArray, optional\n        Output buffer. Use `None` for automatic allocation.\n\n    Returns\n    -------\n    NDArray\n        An `NDArray` containing the image.\n\n    Example\n    -------\n    >>> mx.img.imread("flower.jpg")\n    <NDArray 224x224x3 @cpu(0)>\n\n    Set `flag` parameter to 0 to get grayscale output\n\n    >>> mx.img.imread("flower.jpg", flag=0)\n    <NDArray 224x224x1 @cpu(0)>\n\n    Set `to_rgb` parameter to 0 to get output in OpenCV format (BGR)\n\n    >>> mx.img.imread("flower.jpg", to_rgb=0)\n    <NDArray 224x224x3 @cpu(0)>\n    '
    return _internal._cvimread(filename, *args, **kwargs)
Read and decode an image to an NDArray.

Note: `imread` uses OpenCV (not the CV2 Python library).
MXNet must have been built with USE_OPENCV=1 for `imdecode` to work.

Parameters
----------
filename : str
    Name of the image file to be loaded.
flag : {0, 1}, default 1
    1 for three channel color output. 0 for grayscale output.
to_rgb : bool, default True
    True for RGB formatted output (MXNet default).
    False for BGR formatted output (OpenCV default).
out : NDArray, optional
    Output buffer. Use `None` for automatic allocation.

Returns
-------
NDArray
    An `NDArray` containing the image.

Example
-------
>>> mx.img.imread("flower.jpg")
<NDArray 224x224x3 @cpu(0)>

Set `flag` parameter to 0 to get grayscale output

>>> mx.img.imread("flower.jpg", flag=0)
<NDArray 224x224x1 @cpu(0)>

Set `to_rgb` parameter to 0 to get output in OpenCV format (BGR)

>>> mx.img.imread("flower.jpg", to_rgb=0)
<NDArray 224x224x3 @cpu(0)>
def imread(filename, *args, **kwargs):
    'Read and decode an image to an NDArray.\n\n    Note: `imread` uses OpenCV (not the CV2 Python library).\n    MXNet must have been built with USE_OPENCV=1 for `imdecode` to work.\n\n    Parameters\n    ----------\n    filename : str\n        Name of the image file to be loaded.\n    flag : {0, 1}, default 1\n        1 for three channel color output. 0 for grayscale output.\n    to_rgb : bool, default True\n        True for RGB formatted output (MXNet default).\n        False for BGR formatted output (OpenCV default).\n    out : NDArray, optional\n        Output buffer. Use `None` for automatic allocation.\n\n    Returns\n    -------\n    NDArray\n        An `NDArray` containing the image.\n\n    Example\n    -------\n    >>> mx.img.imread("flower.jpg")\n    <NDArray 224x224x3 @cpu(0)>\n\n    Set `flag` parameter to 0 to get grayscale output\n\n    >>> mx.img.imread("flower.jpg", flag=0)\n    <NDArray 224x224x1 @cpu(0)>\n\n    Set `to_rgb` parameter to 0 to get output in OpenCV format (BGR)\n\n    >>> mx.img.imread("flower.jpg", to_rgb=0)\n    <NDArray 224x224x3 @cpu(0)>\n    '
    return _internal._cvimread(filename, *args, **kwargs)