What is convolution in 2D?
Image is denoted as matrix inside computer. An image contains a lot of features like edge, contrast etc. In image processing features have to be extracted from the image for further study of image.
Convolution is a fundamental operation on images in which a mathematical operation is applied to each pixel to get the desired result.
For this purpose, another matrix called as kernel is used which is smaller in size of image. This is also called filter. This filter is applied on each pixel of the image and new value obtained is the value of that pixel. The image obtained is called filtered image.
In kernel each cell contain some value, that kernel is kept above the pixel and corresponding values are multiplied and then summed up this value obtained is new the value of pixel.
What is Blurring
If a blurred image is observed carefully then a common thing to notice is that image is smooth meaning edges are not observed. A filter used for blurring is also called low pass filter, because it allows low frequency to enter and stop high frequency. Here frequency means the change of pixel value. Around edge pixel value changes rapidly as blur image is smooth so high frequency should be filtered out.
For blur purpose a filter with every call having value 1 is used because to blur image a pixel value should be close to neighbor value.
In filter it is divided by 9 for normalization otherwise value of a pixel will increase resulting in more contrast which is not the goal.
We can choose the size of the kernel depending on how much we want to smoothen the image. Choosing a bigger size will be averaging over a larger area. This tends to increase the smoothening effect.
Blurred with filter of 3 x 3
Blurred with filter of 5 x 5
Blurred with filter of 7 x 7
With large filter the images smoothed more.
- Python | Image blurring using OpenCV
- Image Processing in Java | Set 4 (Colored image to Negative image conversion)
- Image Processing in Java | Set 6 (Colored image to Sepia image conversion)
- Image Processing in Java | Set 3 (Colored image to greyscale image conversion)
- Image Processing in Java | Set 5 (Colored to Red Green Blue Image Conversion)
- Image Processing in Java | Set 7 (Creating a random pixel image)
- MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
- Image Processing in Java | Set 8 (Creating mirror image)
- Image Processing in Java | Set 11 (Changing orientation of image)
- Getting started with Scikit-image: image processing in Python
- Image Processing in Java | Set 10 ( Watermarking an image )
- MATLAB | RGB image to grayscale image conversion
- Image Formats
- Image Inpainting using OpenCV
- MATLAB | RGB image representation
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.