# Filter Examples¶

[1]:

from easycv import Image
from easycv.transforms.filter import Blur, Sharpen, Sharpness


For this example we will load an image with random(). For more examples of image loading check Image examples.

[2]:

img = Image.random()
img

[2]:


## Blur¶

To blur an image we simply apply the Blur transform with the desired method, for more information check the reference.

[3]:

img.apply(Blur(method="gaussian", size=11))

[3]:

[4]:

img.apply(Blur(method="bilateral"))

[4]:


## Sharpness¶

You can detect how sharpen an image image by applying the Sharpness transform, for more information check the reference.

[6]:

img

[6]:

[5]:

img.apply(Sharpness())

[5]:

{'sharpness': 325.05299530543067, 'sharpen': True}


We can see that the image is sharpen. Now let’s test on a blurry image.

[7]:

img_blurry = Image('images/blurred.jpg')
img_blurry

[7]:

[8]:

img_blurry.apply(Sharpness())

[8]:

{'sharpness': 14.315561379722062, 'sharpen': False}


## Sharpen¶

To Sharpen an image we simply apply the Sharpen transform, for more information check the reference.

[9]:

img.apply(Sharpen())

[9]: