How to do Image Noise Removal

Yulewalk algorithm

Task Overview:

Task 1: We had to perform a frequency response test upon the IIR filter using an appropriate input signal to verify data in the required frequency bands is passed by the filter.

Task 2: Basically we obtained an image with lot of noise that was done over it, we had to remove that noise. To achieve that Median filter method was used.

Task 1

For task one we had to utilize Nyquist frequency & IIR filter and yulewalk, Using these methods and theories we designed such a system in Matlab that could achieve the task. Let’s take a brief review on what these methods are about:

Nyquist frequency

The Nyquist frequency is the data transmission of an inspected signal, and is equivalent to a large portion of the sampling frequency of that signal. On the off chance that the tested signal ought to speak to a ceaseless ghostly range beginning at 0 Hz, the Nyquist frequency is the most elevated frequency that the examined signal can unambiguously speak to. The Nyquist frequency, likewise called the Nyquist limit, is the most elevated frequency that can be coded at a given sampling rate in order to have the capacity to completely recreate the signal, i.e.

In order to recuperate each of the Fourier segments of an occasional waveform, it is important to utilize a sampling rate v in any event double the most elevated waveform frequency.

 

IIR & Yulewalk:

 

The essential point of interest of IIR filters is that they regularly meet a given arrangement of particulars with a much lower filter order. Despite the fact that IIR filters have nonlinear stage, the whole information grouping is accessible preceding filtering. This takes into account a non-causal, zero-stage filtering approach, which wipes out the nonlinear stage mutilation of an IIR filter. The immediate filter design function yulewalk finds a filter with extent reaction approximating a fancied function. This is one approach to make a multiband bandpass filter.

yulewalk designs recursive IIR computerized filters utilizing a minimum squares fit to a predetermined frequency reaction. yulewalk performs a scarcest squares fit in the time area. It processes the denominator coefficients utilizing changed Yule-Walker comparisons, with connection coefficients registered by backwards Fourier change of the predefined frequency reaction.

% Yulewalk algorithm

 

%array frequ

f = [0 0.6 0.6 1];

%array magnitude

m = [1 1 0 0];

%calling algirtm of tylewalk

%8th order filter

%cutoff freq 0.6

[b,a] = yulewalk(8,f,m);

[h,w] = freqz(b,a,128);

 

%to show figure plot in matlab

figure

plot(w/pi,abs(h),f,m,’–‘)

 

%setting tiles and labels here

xlabel ‘Radian frequency (\omega/\pi)’, ylabel Magnitude

legend(‘Yule-Walker’,’Ideal’), legend boxoff

 

 

%random function in matlab

x = randn(2048,1);

%xmean function in matlab

 

x = x-mean(x);

%passing digital signal processing source

Hsr = dsp.SignalSource;

%Initlizeing source

Hsr.Signal = x;

%getting log of signalsink

Hlog = dsp.SignalSink;

 

% Analog Butterworth filter

N = 10;

Fc = 0.4;

[b,a] = butter(N,Fc);

 

%applying IIR filter on numerator…

 

H=dsp.IIRFilter(‘Numerator’,b,’Denominator’,a);

 

%applying Spectrum Analyzer

On filter plotting it on the real time graph .. overlapping data continually

 

h = dsp.SpectrumAnalyzer(‘SampleRate’,8e3,…

    ‘PlotAsTwoSidedSpectrum’,false,…

    ‘OverlapPercent’, 80,’PowerUnits’,’dBW’,…

    ‘YLimits’, [-220 -10]);

 

 

 

 

%till Hsr done it ll keep getting input and step over each data to complete action….

while ~isDone(Hsr)

  input = step(Hsr);

  output = step(H,input);

  step(h,output)

  step(Hlog,output);

end

 

%once action done… we ll have a bugger of Hsrloger in hlog.bugger we ll take it in result

 

%And pass it to fvtool to displays the magnitude response of the digital filter defined with numerator

 

Result = Hlog.Buffer;

fvtool(H,’Fs’,8000)

 

%combining results here

D = fdesign.comb(‘notch’,’N,BW’,8,0.02);

H = design(D,’systemobject’,true)

fvtool(H);

 

b = [0.9 zeros(9,1)’ -0.9];

a = [1 zeros(9,1)’ -0.8];

H = dsp.IIRFilter(‘Numerator’,b,’Denominator’,a)

fvtool(H);

 

Output Screens Task 1:

1-1

1-2

1-3

1-4

1-5

Task 2

Median Filtering:

Thresholding and image equalization are illustrations of nonlinear operations, just like the median filter. Median filtering is a nonlinear technique used to expel noise from images. It is broadly utilized as it is extremely compelling at evacuating noise while saving edges. It is especially viable at uprooting ‘salt and pepper’ sort noise. The median filter works by traveling through the image pixel by pixel, supplanting every value with the median value of neighboring pixels. The example of neighbors is known as the “window”, which slides, pixel by pixel over the whole image. The median is figured by first sorting all the pixel values from the window into numerical request, and afterward supplanting the pixel being considered with the center/median pixel value.

The fundamental thought of the median filter is to gone through the sign section by passage, supplanting every section with the median of neighboring passages. The example of neighbors is known as the “window”, which slides, passage by section, over the whole flag. For 1D signals, the most evident window is only the initial few going before and taking after sections, while for 2D signals, for example, images, more mind boggling window examples are conceivable. Note that if the window has an odd number of sections, then the median is easy to characterize: it is only the center value after every one of the passages in the window are sorted numerically.

Regularly, by a wide margin most of the computational exertion and time is spent on ascertaining the median of every window. Since the filter must process each passage in the sign, for expansive signals, for example, images, the proficiency of this median count is a basic variable in deciding how quick the calculation can run. The “vanilla” usage depicted above sorts each passage in the window to locate the median; in any case, subsequent to just the center value in a rundown of numbers is required, choice calculations can be substantially more effective. Besides, a few sorts of signals utilize entire number representations: in these cases, histogram medians can be significantly more productive in light of the fact that it is easy to redesign the histogram from window to window, and finding the median of a histogram is not especially grave.

Process:

An image is a photo, photo or some other type of 2D representation of any scene. Most algorithms for changing over image sensor information to an image, whether in-camera or on a PC, include some type of noise reduction. There are numerous methods for this, yet all endeavor to figure out if the genuine contrasts in pixel values constitute noise or genuine photographic detail, and normal out the previous while endeavoring to save the last mentioned. Notwithstanding, no calculation can make this judgment splendidly, so there is frequently a tradeoff made between noise evacuation and protection of fine, low-differentiate detail that may have qualities like noise. Numerous cameras have settings to control the forcefulness of the in-camera noise reduction.

The high affectability image nature of a given camera may depend extraordinarily on the nature of the calculation utilized for noise reduction. Since noise levels increment as ISO affectability is expanded, most camera producers build the noise reduction forcefulness consequently at higher sensitivities. This prompts a breakdown of image quality at higher sensitivities in two ways: noise levels increment and fine detail is smoothed out by the more forceful noise reduction.

A streamlined sample of the invalid possibility of unambiguous noise reduction: a zone of uniform red in an image may have a little dark part. In the event that this is a solitary pixel, it is liable to be spurious and noise; on the off chance that it covers a couple of pixels in a totally general shape, it might be a deformity in a gathering of pixels in the image-taking sensor on the off chance that it is unpredictable, it might will probably be a genuine component of the

image. Be that as it may, a complete answer is not accessible.

In instances of amazing noise, for example, galactic images of extremely removed items, it is less a matter of noise reduction as of separating a little data covered in a great deal of noise; procedures are distinctive, looking for little regularities in hugely irregular information.

This choice can be helped by knowing the attributes of the source image and of human vision. Most noise reduction algorithms perform a great deal more forceful Chroma noise reduction, since there is minimal vital fine Chroma detail that one dangers losing. Moreover, numerous individuals discover luminance noise less offensive to the eye, since its textured appearance mirrors the presence of film grain.

% read image with imread method

colorImage = imread(‘testImage.jpg’);

 

% get r g b channels into different matrices

 

r = colorImage(:,:,1);

g = colorImage(:,:,2);

b = colorImage(:,:,3);

 

% create KMedian average filter with threshold 3 and pass each color channel to the filter

% averaging the 3 channels using kmedian

Kaverager = filter2(fspecial(‘average’,3),r)/255;

Kaverageg = filter2(fspecial(‘average’,3),g)/255;

Kaverageb = filter2(fspecial(‘average’,3),b)/255;

% concatenate all three color matrices to gain the color image with noise removed

Kaverage = cat(3,Kaverager,Kaverageg,Kaverageb);

Noise Remove:

A simple way to remove the specific color noise is to split the RGB matrices and use a Gaussian blur mask to blur the image. This procedure reduces sharpness from the image thus making it less noisy.

 

 

Output Screenshots:

Input Screen:

Output Screen:

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here