- mmcv.image.adjust_sharpness(img, factor=1.0, kernel=None)¶
Adjust image sharpness.
This function controls the sharpness of an image. An enhancement factor of 0.0 gives a blurred image. A factor of 1.0 gives the original image. And a factor of 2.0 gives a sharpened image. It blends the source image and the degenerated mean image:\[output = img * factor + degenerated * (1 - factor)\]
img (ndarray) – Image to be sharpened. BGR order.
factor (float) – Same as
kernel (np.ndarray, optional) – Filter kernel to be applied on the img to obtain the degenerated img. Defaults to None.
No value sanity check is enforced on the kernel set by users. So with an inappropriate kernel, the
adjust_sharpnessmay fail to perform the function its name indicates but end up performing whatever transform determined by the kernel.
The sharpened image.
- Return type