Box averaging technique
Box averaging can be defined as the intensity of the corresponding pixel would be replaced with the average of all intensities of its neighbour pixels spanned by the box. This is a point operator.
Now, let’s suppose the box size is 5 by 5. It will span over 25 pixels at one time. The intensity value of the central pixel (point operator on central pixel) will be the average of intensities of all the 25 pixels covered by the box of 5 by 5 dimensions.
Example:
Matlab
% MATLAB code for Box averaging % Read the cameraman image. k1=imread( "cameraman.jpg" ); % create the noise of standard deviation 25 n=25*randn(size(k1)); %add the noise to the image=noisy_image k2=double(k1)+n; %display the noisy image. imtool(k2,[]); %averaging using [5 5] sliding box. k3=uint8(colfilt(k2,[5 5], 'sliding' , @mean)); %display the denoised image. imtool(k3,[]); %averaging using [9 9] sliding box. k4=uint8(colfilt(k2, [9 9], 'sliding' , @mean)); %display the denoised image. imtool(k4,[]); |
Output:
But there are some disadvantages of this technique:
- It reduces the noise to a small extent but introduces blurriness in the image.
- If we increase the box size then smoothness and blurriness in the image increase proportionately.
Denoising techniques in digital image processing using MATLAB
Denoising is the process of removing or reducing the noise or artifacts from the image. Denoising makes the image more clear and enables us to see finer details in the image clearly. It does not change the brightness or contrast of the image directly, but due to the removal of artifacts, the final image may look brighter.
In this denoising process, we choose a 2-D box and slide it over the image. The intensity of each and every pixel of the original image is recalculated using the box.