In: Advanced Math
Adaptive bilateral filter (ABF) is used for sharpness enhancement and noise removal. The ABF sharpens an image by increasing the slope of the edges without producing overshoot or undershoot. It is an approach to enhance sharpness which is fundamentally different from the unsharp mask (USM). The approach is used in slope restoration and it also differs significantly from previous slope restoration algorithms. i) Design and Develop a Graphical User Interface (GUI) using Matlab for enhancing the sharpness with degraded image for Adaptive Bilateral filter. ii) Show separate results for Adding and Removing the noise using Adaptive Bilateral filter with a matlab Program in the designed GUI. iii) Involve a separate panel in GUI for Validating the work with objective assessment of MSE and PSNR.
note: using matlab
Solution :
Bilateral filtering has popular in image processing due to its capability of reducing noise while preserving the structural information of an image. The detail preserving property of the filter is mainly caused by the nonlinear filter component. It select the pixels of similar intensity which are averaged by a linear component afterward.
(iii) Involve a separate panel in GUI for Validating the work with objective assessment of MSE and PSNR
MSE and PSNR are the algorithms historically adopted in image processing in order to evaluate the performance of codec of interest; they are closely linked to and borrowed from other contexts of signal processing.
Let X and Y be the two arrays of size NxM which respectively representing the Y-channel frame of reference (i.e. the original copy) and Y-channel frame of encoded/impaired copy.
The mean square error between the two signals is defined by -
MSE = 1 / (N x M) [X (i, j) - Y (i, j)]2
The PSNR is defined by -
PSNR = 10 log10 (L2 / MSE)
MATLAB CODE
function [mse, psnr] = mse_psnr (img1, img2, L)
% mse_psnr (img1, img2, L)
% img1 is the reference frame, img2 is the encoded frame
% L is the bit color depth of each channel (usually, L = 8 bit)
% it works with RGB frames acquired through imread() or mmreader()
pixel_max = (2L)-1;
% setting the maximum value that a pixel can assume
% comment the following two lines if the frames are already in YCbCr
img1 = rgb2ycbcr (img1);
% converting from RGB to YCbCr
img2 = rgb2ycbcr (img2) ;
% converting from RGB to YCbCr
img 1 = img1 (: , : , 1) ;
% extracting the luminance component (Y)
img2 = img2 (: , : , 1) ;
% extracting the luminance component (Y)
img1 = img1 (:) ;
% converts a matrix into a monodimensional array
img2 = img2 (:) ;
% converts a matrix into a monodimensional array
x = 0 ;
img1 = double (img1) ;
img2 = double (img2) ;
x = (img1 - img2) . ^2 ;
mse = mean (x) ;
% here is the MSE
psnr = 10 log10 ( ( (pixel_max)^2 / (mse) ) ;
% and here is the PSNR
return
*********************************************************************************************************************