def change_sharpness(image, sharpness=1.0):
"""
Change sharpness of image.
>>> image = np.eye(3, dtype='uint8') * 255
>>> change_sharpness(image, 0.5)
array([[255, 0, 0],
[ 0, 196, 0],
[ 0, 0, 255]], dtype=uint8)
See
http://pillow.readthedocs.io/en/3.1.x/reference/ImageEnhance.html#PIL.ImageEnhance.Sharpness
:param numpy array image: Numpy array with range [0,255] and dtype 'uint8'.
:param float sharpness: Sharpness [0, ...]
:return: Image with changed sharpness
:rtype: numpy array with range [0,255] and dtype 'uint8'
"""
return enhance(image, ie.Sharpness, sharpness)
评论列表
文章目录