(img, angle, expand=True, fill=0, interpolation=PIL.Image.BILINEAR)
Rotate images by degrees.

    The backend used by :func:`rotate` is configured by
    :obj:`chainer.global_config.cv_rotate_backend`.
    Two backends are supported: "cv2" and "PIL".
    If this is :obj:`None`, "cv2" is used whenever "cv2" is installed,
    and "PIL" is used when "cv2" is not installed.

    Args:
        img (~numpy.ndarray): An arrays that get rotated. This is in
            CHW format.
        angle (float): Counter clock-wise rotation angle (degree).
        expand (bool): The output shaped is adapted or not.
            If :obj:`True`, the input image is contained complete in
            the output.
        fill (float): The value used for pixels outside the boundaries.
        interpolation (int): Determines sampling strategy. This is one of
            :obj:`PIL.Image.NEAREST`, :obj:`PIL.Image.BILINEAR`,
            :obj:`PIL.Image.BICUBIC`.
            Bilinear interpolation is the default strategy.

    Returns:
        ~numpy.ndarray:
        returns an array :obj:`out_img` that is the result of rotation.
Rotate images by degrees.
Rotate images by degrees .
def rotate(img, angle, expand=True, fill=0, interpolation=PIL.Image.BILINEAR):
    """Rotate images by degrees.

    The backend used by :func:`rotate` is configured by
    :obj:`chainer.global_config.cv_rotate_backend`.
    Two backends are supported: "cv2" and "PIL".
    If this is :obj:`None`, "cv2" is used whenever "cv2" is installed,
    and "PIL" is used when "cv2" is not installed.

    Args:
        img (~numpy.ndarray): An arrays that get rotated. This is in
            CHW format.
        angle (float): Counter clock-wise rotation angle (degree).
        expand (bool): The output shaped is adapted or not.
            If :obj:`True`, the input image is contained complete in
            the output.
        fill (float): The value used for pixels outside the boundaries.
        interpolation (int): Determines sampling strategy. This is one of
            :obj:`PIL.Image.NEAREST`, :obj:`PIL.Image.BILINEAR`,
            :obj:`PIL.Image.BICUBIC`.
            Bilinear interpolation is the default strategy.

    Returns:
        ~numpy.ndarray:
        returns an array :obj:`out_img` that is the result of rotation.

    """
    if chainer.config.cv_rotate_backend is None:
        if _cv2_available:
            return _rotate_cv2(img, angle, expand, fill, interpolation)
        else:
            return _rotate_pil(img, angle, expand, fill, interpolation)
    elif chainer.config.cv_rotate_backend == 'cv2':
        if not _cv2_available:
            raise ValueError('cv2 is not installed even though '
                             'chainer.config.cv_rotate_backend == \'cv2\'')
        return _rotate_cv2(img, angle, expand, fill, interpolation)
    elif chainer.config.cv_rotate_backend == 'PIL':
        return _rotate_pil(img, angle, expand, fill, interpolation)
    else:
        raise ValueError('chainer.config.cv_rotate_backend should be '
                         'either "cv2" or "PIL".')
def rotate ( img , angle , expand = True , fill = 0 , interpolation = PIL . Image . BILINEAR ) : if chainer . config . cv_rotate_backend is None : if _cv2_available : return _rotate_cv2 ( img , angle , expand , fill , interpolation ) else : return _rotate_pil ( img , angle , expand , fill , interpolation ) elif chainer . config . cv_rotate_backend == 'cv2' : if not _cv2_available : raise ValueError ( 'cv2 is not installed even though ' 'chainer.config.cv_rotate_backend == \'cv2\'' ) return _rotate_cv2 ( img , angle , expand , fill , interpolation ) elif chainer . config . cv_rotate_backend == 'PIL' : return _rotate_pil ( img , angle , expand , fill , interpolation ) else : raise ValueError ( 'chainer.config.cv_rotate_backend should be ' 'either "cv2" or "PIL".' )