imageutil.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:nuts-ml 作者: maet3608 项目源码 文件源码
def change_brightness(image, brightness=1.0):
    """
    Change brightness of image.

    >>> image = np.eye(3, dtype='uint8') * 255
    >>> change_brightness(image, 0.5)
    array([[127,   0,   0],
           [  0, 127,   0],
           [  0,   0, 127]], dtype=uint8)

    See
    http://pillow.readthedocs.io/en/3.1.x/reference/ImageEnhance.html#PIL.ImageEnhance.Brightness

    :param numpy array image: Numpy array with range [0,255] and dtype 'uint8'.
    :param float brightness: Brightness [0, 1]
    :return: Image with changed brightness
    :rtype: numpy array with range [0,255] and dtype 'uint8'
    """
    return enhance(image, ie.Brightness, brightness)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号