mmcv.image.adjust_sharpness¶
- 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
mmcv.adjust_brightness()
.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_sharpness
may fail to perform the function its name indicates but end up performing whatever transform determined by the kernel.- 返回
The sharpened image.
- 返回类型
ndarray