-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject.Report.tex
1335 lines (1077 loc) · 62.9 KB
/
Project.Report.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[hidelinks,12pt]{article}
\usepackage{graphicx}
\usepackage{layout}
\usepackage{amsmath, amssymb}
\usepackage{hyperref}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage[dvipsnames]{xcolor}
\usepackage{lipsum}
\usepackage{cleveref}
\usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{overpic}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{enumitem}
\pagestyle{fancy}
\fancyhf{}
% \renewcommand{\headrulewidth}{0pt}
\cfoot{\thepage}
\setlength{\parindent}{0pt}
\author{M.M. Roshani}
\begin{document}
\begin{titlepage}
\begin{center}
\includegraphics[width=10cm]{figures/SUT_logo.png} \\
\vspace{1cm}
\textbf{\Large ENGINEERING MATHEMATICS PROJECT}\\
\vspace{0.5cm}
Instructor: Prof. Hamid Aghajan\\
\vspace{1cm}
\textbf{\Large SHARIF UNIVERSITY OF TECHNOLOGY}\\
\vspace{1cm}
\rule{\linewidth}{0.5mm} \\
\vspace{0.5cm}
{\Huge \textbf{From Noise to Clarity:}}\\
\vspace{0.3cm}
{\huge \textbf{A Study of Filtering Techniques in}}\\
\vspace{0.3cm}
{\huge \textbf{Biomedical Imaging}}\\
\rule{\linewidth}{0.5mm} \\
\vfill
\textbf{\Large M.M. Roshani}
\end{center}
\end{titlepage}
\tableofcontents
\newpage
\section{Aspects of an Image}
Using Figure~\textcolor{Cyan}{\ref{fig:kobe}} answer the following questions: \\
\textbf{1.} Intuitively, What do low and high frequencies of an arbitrary image contain? Which
one is more important? Do you think your answer depends on the image? Explain it.
\\ \\
Intuitively, high-frequency components represent sudden changes in an image, such as edges or details. We humans can detect objects based on high frequencies. On the other hand, low frequencies correspond to smooth changes or uniform areas of an image. For instance, in fingerprints, high frequencies are more important. Because without them, it would be impossible to see the outlines of ridges. Conversely, in images with gradual transitions, like landscapes, lower frequencies can give us more information. Therefore, determining which one is more important depends on the context.
\vspace*{2\baselineskip}
\textbf{2.} Explain about low pass filter(LPF) and high pass filter(HPF). In what applications LPF and HPF are used? Write two functions that apply LPF and HPF to an arbitrary image.
\begin{figure}[b!]
\centering
\includegraphics[scale=0.28]{figures/pic1.jpg}
\caption{Kobe Bryant (August 23, 1978– January 26, 2020)}
\label{fig:kobe}
\end{figure}
\pagebreak
A Low-Pass Filter (LPF) allows signals with frequencies lower than a certain cutoff frequency to pass through while diminishing higher frequencies. On the other hand, a High-Pass Filter (HPF) allows signals with frequencies higher than a cutoff frequency to pass while attenuating lower frequencies. Let's look at two applications of each filter.
\begin{itemize}
\item \textbf{Audio Processing:} LPFs remove high-frequency noise and hiss, making speech and music smoother, commonly used in hearing aids and audio mixing. HPFs eliminate low-frequency disturbances like wind noise, mic handling noise, and electrical hum, improving clarity in recordings and live audio.
\item \textbf{Image Processing:} LPFs blur images to reduce noise and smooth details, useful in artifact reduction. They are also used in image compression by removing high-frequency details before quantization, reducing data complexity and improving compression efficiency. HPFs enhance edges and fine details, aiding in sharpening, edge detection, and applications like medical imaging and fingerprint recognition.
\end{itemize}
Now we apply LPF and HPF to the image below.
\begin{figure}[hb!]
\centering
\includegraphics[scale=0.25]{figures/christmas_eve.jpg}
\caption{CHRISTMAS EVE | CARL IVAR GILBERT}
\end{figure}
\begin{figure}[!h]
\centering
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/christmas_eve_lpf.png}
\end{subfigure}
\hfill
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/christmas_eve_hpf.png}
\end{subfigure}
\end{figure}
\pagebreak
\textbf{3.} Apply LPF and HPF to Figure~\textcolor{Cyan}{\ref{fig:kobe}} using functions written in the previous part. Explain the results.
\begin{figure}[hb!]
\centering
\includegraphics[scale=0.62]{figures/kobe_lpf.png}
\end{figure}
\begin{figure}[hb!]
\centering
\includegraphics[scale=0.62]{figures/kobe_hpf.png}
\end{figure}
In the top image, the player's jersey, face, and overall shape are smooth, but details like the jersey's text edges and facial features are less apparent. In the bottom, the edges of the player's jersey, the ball, and facial features are visible, while flat regions (like the background and smooth surfaces) are darkened. As expected, applying an LPF makes the image blurry and results in a loss of detail. On the other hand, an HPF enhances edges and brings out finer details.
\pagebreak
Using Figure~\textcolor{Cyan}{\ref{fig:pic2}} and Figure~\textcolor{Cyan}{\ref{fig:pic3}} answer questions below.
\begin{figure}[h]
\centering
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/pic2.jpg}
\caption{Wheat Field with Cypresses}
\label{fig:pic2}
\end{subfigure}
\hfill
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/pic3.jpg}
\caption{Irises}
\label{fig:pic3}
\end{subfigure}
\end{figure}
\textbf{4.} Plot the magnitude and phase of both images. Then, plot an image with magnitude of Figure~\ref{fig:pic2} and phase of Figure~\ref{fig:pic3}. Plot the other alternate.
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/pic2_mag.PNG}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/pic2_phase.PNG}
\end{subfigure}
\caption{Magnitude and phase plot of Figure~\ref{fig:pic2}}
\end{figure}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/pic3_mag.PNG}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/pic3_phase.PNG}
\end{subfigure}
\caption{Magnitude and phase plot of Figure~\ref{fig:pic3}}
\end{figure}
\pagebreak
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mag3_phase2.PNG}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mag2_phase3.PNG}
\end{subfigure} \\
\begin{subfigure}[h]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mag3_phase2_color.PNG}
\caption{Magnitude Fig.~\ref{fig:pic3} + Phase Fig.~\ref{fig:pic2}}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mag2_phase3_color.PNG}
\caption{Magnitude Fig.~\ref{fig:pic2} + Phase Fig.~\ref{fig:pic3}}
\end{subfigure}
\end{tabular}
\caption{}
\label{fig:mixed_phase_mag}
\end{figure}
\textbf{5.} Using the results above, Explain Why is the phase information more critical for reconstructing recognizable features of an image compared to the magnitude information?
\paragraph{}
If we compare Figure~\ref{fig:mixed_phase_mag} with the original images, we can see that the images with the same phase look similar. That is because the phase information plays a critical role in reconstructing recognizable features of an image. It determines the spatial arrangement of the image's frequency components. While the magnitude provides the strength or amplitude of each frequency, it does not convey how these frequencies are arranged in space. The phase information, however, controls the placement of edges and shapes in an image, which are key to its structure.
\paragraph{}
When the phase is altered, even if the magnitude remains intact, the image loses its structure. This results in a blurred or distorted image that lacks recognizable features. Although the intensity (magnitude) might still be visible in some form, the critical spatial relationships that define the image are missing.
\paragraph{}
In contrast, removing the magnitude while preserving the phase leads to a loss of intensity and sharpness, but the image's overall structure can still be detected. This shows that phase information is more important for the spatial arrangement of features, whereas magnitude primarily influences the contrast and brightness of the image.
\pagebreak
\section{Noise}
\subsection{Questions}
\textbf{1.} What are the primary sources of salt-and-pepper noise in digital images, and what filtering techniques are most effective in mitigating this type of noise?
\\ \\
Salt-and-pepper noise, characterized by random white (salt) and black (pepper) pixels, is a type of impulse noise that can degrade the quality of digital images. The primary sources of salt-and-pepper noise are:
\begin{itemize}
\item \textbf{Sensor Malfunctions}: Faulty sensors or detectors in digital cameras or imaging devices can cause random bright or dark pixels in the captured image.
\item \textbf{Transmission Errors}: During data transmission (such as when sending images over a network), errors or corruption in the data stream can lead to random pixel values being replaced.
\item \textbf{Environmental Factors}: Low-quality or malfunctioning hardware, such as old or poorly maintained imaging devices, can also introduce noise. Electromagnetic interference or poor lighting conditions can also worsen these issues.
\end{itemize}
\textbf{Effective Filtering Techniques:} Two of the most common filtering techniques are:
\begin{itemize}
\item \textbf{Median Filtering}
Median filtering is the most commonly used and effective method for salt-and-pepper noise. It works by replacing each pixel value with the median value of its neighboring pixels within a defined window (e.g., a 3x3 or 5x5 window). The median filter is particularly effective because it is good at preserving edges while removing the extreme values (salt and pepper).
\item \textbf{Adaptive Filters}
Adaptive filtering techniques, such as adaptive median filtering, adjust the size of the filtering window based on local characteristics of the image (e.g., noise density). These filters can adapt to different noise levels and are particularly useful when the noise density varies across the image.
\end{itemize}
\textbf{2.} How does electrical interference introduce 50Hz noise into signal recordings, and what methods can be employed to eliminate or reduce this interference?
\\ \\
Electrical interference often arises from the power supply grid, which in many regions operates at a frequency of 50Hz (or 60Hz in some countries). This can introduce periodic noise at the same frequency (50Hz) into signal recordings, especially in environments with sensitive electronic equipment like audio, video, or biomedical signal recording devices.
\pagebreak
The primary causes of this interference include:
\begin{itemize}
\item \textbf{Coupling from Power Lines}: Electrical systems, especially AC power lines, emit electromagnetic fields that can couple with the cables and circuits of nearby recording equipment. The interference can enter the system through means such as direct contact, capacitive or inductive coupling.
\item \textbf{Ground Loops}: Equipment connected to different ground points may experience a difference in electrical potential, creating a loop that picks up noise from the power supply.
\item \textbf{Imperfect Shielding}: Cables and equipment that are not adequately shielded may act as antennas, picking up electromagnetic noise and introducing it into the signal.
\end{itemize}
\textbf{Methods to Eliminate or Reduce 50Hz Noise}
\begin{itemize}
\item \textbf{Notch Filtering}: A notch filter is a type of band-stop filter that specifically targets and removes a narrow frequency band, such as the 50Hz noise. It suppresses the 50Hz component while allowing other frequencies in the signal to pass through unaffected. This method is highly effective when the 50Hz noise is isolated and does not overlap with important signal frequencies.
\item \textbf{Low-Pass or High-Pass Filtering}: A low-pass filter (to remove higher frequency noise) or a high-pass filter (to remove low-frequency interference) can help eliminate certain portions of the signal that may contain 50Hz noise. However, this method is less specific than a notch filter and may accidentally remove important signal content.
\end{itemize}
\textbf{3.} Identify the common sources of Gaussian noise in imaging systems and discuss the most suitable algorithms for its removal without significantly degrading image quality.
Gaussian noise, often modeled as random variations in pixel values with a Gaussian distribution, is a common type of noise in imaging systems. The sources of Gaussian noise include:
\begin{itemize}
\item \textbf{Sensor Noise}: The most common source of Gaussian noise is the image sensor itself. Sensors, such as CCD (Charge-Coupled Device) or CMOS (Complementary Metal-Oxide-Semiconductor) sensors, can introduce noise due to thermal fluctuations, photon shot noise, or imperfections in the sensor circuitry.
\item \textbf{Transmission Noise}: Noise can also be introduced during the transmission of the image data from the sensor to the processing unit. This could be due to interference, signal degradation, or errors in the communication channel, often contributing to Gaussian noise characteristics.
\item \textbf{Quantization Noise}: When an image is digitized (e.g., from an analog signal to a digital format), quantization errors can introduce Gaussian noise. This happens when continuous pixel values are mapped to a discrete set of values, leading to small random variations around the true values.
\item \textbf{Environmental Factors}: External factors like temperature and light conditions can also impact the sensor's performance, introducing random noise. For instance, high temperatures can increase thermal noise in the sensor, leading to Gaussian noise in the image.
\end{itemize}
\textbf{Suitable Algorithms for Removal of Gaussian Noise}
\begin{itemize}
\item \textbf{Gaussian Blur (Linear Filtering)}: The Gaussian blur filter is a simple and commonly used method for reducing Gaussian noise. It works by convolving the image with a Gaussian kernel, which smooths the image and reduces high-frequency noise components. While effective at noise reduction, the downside is that it can blur fine details and edges in the image.
\item \textbf{Wiener Filter}: The Wiener filter is an adaptive filtering technique that works well for Gaussian noise removal. Unlike simple linear filters, it adapts to local image characteristics by estimating the local mean and variance, and then applying a filter that minimizes the mean square error between the filtered image and the original. It is more effective than Gaussian blur for preserving image details while reducing noise because it adjusts the degree of smoothing based on the local noise variance. However, it requires prior knowledge of the noise characteristics.
\end{itemize}
\textbf{4.} Explore SNR and PSNR. What roles do Signal-to-Noise Ratio (SNR) and Peak Signal-to-Noise Ratio (PSNR) play in evaluating the effectiveness of noise removal techniques in digital images? Compare and contrast the effectiveness of SNR and PSNR in different applications such as medical imaging, video compression, and wireless communications.
\\ \\
Signal-to-Noise Ratio (SNR) and Peak Signal-to-Noise Ratio (PSNR) are commonly used metrics to evaluate the quality of signals, including digital images, and the effectiveness of noise removal techniques.
\\ \\
\textbf{SNR:} is a measure of the ratio between the desired signal and the background noise. It quantifies how much stronger the signal is compared to the noise. The signal-to-noise ratio of a random variable $S$ to random noise $N$ is:
$$
SNR = \frac{E[S^2]}{E[N^2]}
$$
it is useful in quantifying the overall quality of an image after noise removal, where a higher SNR value suggests that the noise has been effectively reduced without significant loss of detail in the image.
\\ \\
\textbf{PSNR:} is a more specific metric often used in the context of image quality evaluation, particularly when comparing the original and processed (or denoised) images. PSNR is calculated based on the mean squared error (MSE) between the original image and the denoised image. Given a noise-free m×n monochrome image I and its noisy approximation K, MSE is defined as:
$$
MSE = \frac{1}{mn} \sum_{i=0}^{m-1} \sum_{j=0}^{n-1} [I(i,j) - K(i,j)]^2
$$
$$
PSNR = 10 \log_{10}(\frac{MAX_I^2}{MSE})
$$
where $MAX_I$ is the maximum possible pixel value of the image. PSNR is sensitive to pixel-level changes, making it useful for applications where maintaining visual quality is crucial. In contrast, SNR reflects overall signal clarity, explaining why adaptive filters may show lower PSNR despite better visual quality., such as in image compression or denoising tasks.
\pagebreak
\textbf{Comparison in Different Applications}
\begin{itemize}
\item \textbf{Medical Imaging}: SNR is crucial for ensuring that the signal (e.g., clinical details in an MRI or CT scan) is distinguishable from the noise. PSNR is used to evaluate the quality of processed medical images after denoising or compression, ensuring minimal loss of crucial information.
\item \textbf{Video Compression}: PSNR is the preferred metric because it directly assesses the pixel-level quality after compression. SNR is less commonly used in this context, but may be relevant for assessing transmission quality.
\item \textbf{Wireless Communications}: SNR is the key metric here, as it measures the strength of the received signal relative to noise, affecting the clarity and successful decoding of the signal. PSNR is not used in wireless communication.
\end{itemize}
In summary, \textbf{SNR} is more general and widely used in wireless communications, while \textbf{PSNR} is primarily used in image and video processing to evaluate perceptual quality after noise reduction or compression.
\subsection{Noise Modeling}
\subsubsection{Statistical Analysis of Noise Vectors}
\subsubsection*{(a) Generate and Plot Noise Vectors}
Generate two noise vectors $N_1$ and $N_2$ with $a = 0.2$, using uniform and normal distributions respectively, with $L = 10000$. Plot the histogram of each vector. Do the resulting shapes confirm the expected probability distributions?
\\ \\
Using our 'noise' function, we generate and plot both uniform and normal noise. The theoretical distributions are shown alongside the noise plots. As we can see, the noise plots align with our theoretical expectations.
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise_dist.PNG}
\caption{Uniform}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise_dist.PNG}
\caption{Normal}
\end{subfigure}
\caption{Histogram plot of noise}
\end{figure}
\pagebreak
\subsubsection*{(b) Mean of Noise Vectors}
For the noise vector $N_1$, define:
\[ N_1 = \frac{1}{L} \sum_{i=1}^L N_1[i]. \tag{5} \]
Compute $N_1$ for $L \in \{1, 2, \dots, 1000\}$ and plot it as a function of $L$. Repeat the same for $N_2$. What is the limit of $N_1$ and $N_2$ as $L \to \infty$? Which theorem or statement in probability theory precisely explains this result?
\\ \\
First we plot the mean for each one as the number of samples increases.
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_uniform_dist.PNG}
\caption{Uniform}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_normal_dist.PNG}
\caption{Normal}
\end{subfigure}
\caption{Convergence of Mean}
\end{figure}
As we can as N grows larger, the mean converges. We can justify our results by the Law of Large Numbers (LLN). LLN states that the average of the results obtained from a large number of independent random samples converges to the true value. Since in both of our distributions the mean is 0, both of them converge to 0.
\subsubsection*{(c) Energy of Noise Vectors}
Consider the following definition of the energy of a noise vector $N$:
\[ E_N = \frac{1}{L} \sum_{i=1}^L \left(N[i]\right)^2. \tag{6} \]
For each of the two noise vectors $N_1$ and $N_2$, compute the energy as a function of $L$ for $L \in \{1, 2, \dots, 1000\}$, and plot it. What is the limit of $E_{N_1}$ and $E_{N_2}$ as $L \to \infty$? Verify your result through simulation.
\\ \\
First we calculate the theoretical energy of our signals. Since the mean is 0 for both of them, $E_N = \sigma^2$.
\\
$$
E_N \, [\mathcal{N}(0,a^2)] = a^2
$$
$$
E_N \, [U(-a,a)] = \frac{(a-(-a))^2}{12} = \frac{a^2}{3}
$$
\pagebreak
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_energy.PNG}
\caption{Uniform}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_energy.PNG}
\caption{Normal}
\end{subfigure}
\caption{Convergence of Energy}
\end{figure}
As we can see from the figures above, as L increases, $E_N$ converges to its theoretical value.
\subsubsection*{(d) Cross-Correlation of Noise Vectors}
For the two noise vectors $N_1$ and $N_2$, define:
\[ c_{12} = \frac{1}{L} \sum_{i=1}^L N_1[i] N_2[i]. \tag{7} \]
Plot $c_{12}$ as a function of $L$ for $L \in \{1, 2, \dots, 1000\}$. Also, compute the limit of $c_{12}$ as $L \to \infty$ and verify it through simulation. Explain what information $c_{12}$ provides about the two vectors. Justify how $c_{12}$ serves as a measure of similarity.
\\ \\
First we calculate their Cross-Correlation, using probability theory.
\begin{equation*}
\begin{split}
\left.
\begin{alignedat}{4}
Cov(N_1, N_2) = E[N_1 N_2] - E[N_1] E[N_2]\\
E[N_1] = E[N_2] = 0 \\
\text{both are independent}
\end{alignedat}
\right \}
\Rightarrow Cov(N_1, N_2) = 0
\end{split}
\end{equation*}
Since the expected value of both distributions is zero, $c_{12}$ is equal to the $Cov(N_1, N_2)$. And as we know covariance indicates how the values of two random variables move relative to each other.
\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{figures/cross_correlation.png}
\caption{Cross Correlation}
\end{figure}
\pagebreak
\subsubsection{Sinusoidal Signal and Noise Addition} \label{sec:noise_addition}
In this question, the original signal used is a simple sinusoidal signal defined as:
\[ x(t) = \sin(2\pi f_0 t), \quad f_0 = 1 \text{ Hz}. \]
The time range of the signal is considered as \([0, 2]\). Generate the signal $x(t)$ with an appropriate sampling frequency. Plot $x(t)$ and specify the sampling frequency used.
Next, add the noise vectors $N_1$ and $N_2$ to the generated signal to produce two noisy signals $x_{n1}$ and $x_{n2}$:
\[ x_{n1}(t) = x(t) + N_1(t), \quad x_{n2}(t) = x(t) + N_2(t). \tag{8} \]
Plot both noisy signals.
\\ \\
We pick 1000 $\frac{\text{samples}}{\text{s}}$ for sampling rate to have a smooth curve.
\begin{figure}[h!]
\centering
\includegraphics[scale=0.7]{figures/sin.png}
\caption{Original signal (sine wave)}
\end{figure}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/sin_uniform_noise.PNG}
\caption{signal with uniform noise}
\end{subfigure}
\hspace{0.5cm}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/sin_normal_noise.PNG}
\caption{signal with normal noise}
\end{subfigure}
\caption{Noisy signals}
\end{figure}
\subsubsection{Energy Computation of Signals}
Compute the energy of the following signals:
\begin{itemize}
\item The original signal $x$.
\item The noise vectors $N_1$ and $N_2$.
\item The noisy signals $x_{n1}$ and $x_{n2}$.
\end{itemize}
In total, compute the energies of five signals. Report the computed energy values. Verify whether the relation $E_{x_n} = E_x + E_N$ approximately holds. For any two signals $x$ and $y$, determine if the statement $E_{x+y} = E_x + E_y$ is true or false. Prove or disprove the statement and validate it for this specific example.
The calculated values are as follows.
\begin{table}[h!]
\centering
\begin{tabular}{c|c|c|c|c|c|}
\cline{2-6}
& $E_x$ & $E_{noise}$ & $E_{x} + E_{noise}$ & $E_{xn}$ & Relative Difference \\ \hline
\multicolumn{1}{|c|}{Uniform Noise (N1)} & 0.4998 & 0.0134 & 0.5132 & 0.5236 & $\sim$2\% \\ \hline
\multicolumn{1}{|c|}{Normal Noise (N2)} & 0.4998 & 0.0392 & 0.539 & 0.5350 & $\sim$0.7\% \\ \hline
\end{tabular}
\caption{}
\end{table}
Since the differences are relatively small we can say that $E_{x_n} = E_x + E_N$ holds. The discrepancy can be justified by the fact that our sampling size is finite, so if we increasing our sample size, the difference between the theoretical value and the experimental value will shrink.
\\
\textbf{Energy Additivity for Any Two Signals}
Given a discrete signal $x$, its energy is defined as:
$$
E_x = \sum_{i} x_i^2
$$
For two signals $x$ and $y$, their sum $x + y$ has energy:
$$
E_{x+y} = \sum_{i} (x_i + y_i)^2 = \sum_{i} x_i^2 + \sum_{i} y_i^2 + 2\sum_{i} x_i y_i
$$
which simplifies to:
$$
E_{x+y} = E_x + E_y + 2 \sum_{i} x_i y_i
$$
Conclusion: The equation $E_{x+y} = E_x + E_y$ holds only if $\sum_{i} x_i y_i = 0$, meaning $x$ and $y$ must be \textbf{orthogonal} (uncorrelated). In general, the equation is \textbf{false} due to the third term. In our case, since the sine wave and the noise are uncorrelated, this equation holds.
\pagebreak
\subsubsection{Signal-to-Noise Ratio (SNR)}
The ratio of the energy (power) of the original signal to the energy (or power) of the noise is called the Signal-to-Noise Ratio (SNR):
\[ \text{SNR} = \frac{E_x}{E_N}. \]
Compute and report the SNR for the signals $x_{n1}$ and $x_{n2}$ generated in Section~\ref{sec:noise_addition}.
Subsequently, increase the value of $a$ in the noise definitions until the smallest value of $a$ is found such that there is no noticeable visual similarity between $x$ and $x_n$. Report the corresponding value of $a$ and the SNR for each type of noise separately.
\\ \\
We have calculated $E_x$ and $E_N$ of two signals in the previous section. We have:
$$
SNR_1 (\text{Uniform}) = \frac{0.49975}{0.01344} \approx 37.2
$$
$$
SNR_2 (\text{Normal}) \approx \frac{0.4998}{0.0392} \approx 12.7
$$
We plot our noisy signals for different values of noise amplitude (a). The following images approximately show the transition from recongnizability to unrecognizablity.
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.3.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.4.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.5.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.6.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.7.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/uniform_noise/0.8.png}
\end{subfigure} \\
\end{tabular}
\caption{Uniform noise with different Amplitudes}
\end{figure}
We can see that around $a=0.5,\,0.6$, our signal doesn't not visually resemble a sine wave anymore. For instance, the original signal could have been a triangular wave.
\pagebreak
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.2.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.3.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.4.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.5.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.6.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/normal_noise/0.7.png}
\end{subfigure} \\
\end{tabular}
\caption{Normal noise with different Amplitudes}
\end{figure}
We can see that around $a=0.3,\,0.4$, our signal doesn't not visually resemble a sine wave anymore.
\\ \\
It is not strange that the amplitude threshold is lower for normal noise. Since normal distribution is unbounded, even for small values of $a$, large deviations could occur.
\pagebreak
\section{Magnetic Resonance Imaging (MRI): A Comprehensive Overview}
\subsection{Introduction}
Magnetic Resonance Imaging (MRI) is a non-invasive diagnostic technique that produces detailed images of the internal structures of the body. Utilizing strong magnetic fields and radio waves, MRI scans help in diagnosing a variety of conditions by revealing differences between healthy and diseased tissue.
\subsection{How MRI works}
MRI operates on the principles of nuclear magnetic resonance. Here's a step-by-step explanation:
\begin{itemize}
\item \textbf{Magnetic Alignment}: The human body is composed largely of water molecules, which contain hydrogen nuclei (protons). When a person enters the MRI scanner, a powerful magnetic field aligns these protons.
\item \textbf{Radiofrequency Pulses}: Short bursts of radio waves are directed at the aligned protons, knocking them out of their equilibrium state.
\item \textbf{Signal Emission}: When the radiofrequency pulse is turned off, the protons realign with the magnetic field, releasing energy in the process.
\item \textbf{Image Formation}: This released energy is detected by coils in the scanner. Computers process these signals to construct detailed images of the body's interior.
\end{itemize}
\subsection{Brain MRI}
MRI is particularly valuable for neurological applications due to its superior contrast resolution, which allows for:
\begin{itemize}
\item \textbf{Detection of Tumors and Lesions} : Identifying brain tumors, cysts, and other anomalies.
\item \textbf{Stroke Evaluation}: Differentiating between ischemic and hemorrhagic strokes.
\item \textbf{Multiple Sclerosis (MS)}: Visualizing demyelinating plaques characteristic of MS.
\item \textbf{Aneurysm and Vascular Malformations}: Assessing blood vessel integrity and abnormalities.
\item \textbf{Infection and Inflammation}: Detecting conditions like encephalitis or abscesses.
\end{itemize}
\pagebreak
\subsection{Spine MRI}
Spine MRI provides critical information about spinal anatomy and pathology:
\begin{itemize}
\item \textbf{Disc Disorders}: Diagnosing herniated or degenerated discs.
\item \textbf{Spinal Cord Compression}: Identifying causes of spinal cord pressure, such as tumors or bone fragments.
\item \textbf{Inflammation and Infections}: Detecting osteomyelitis or epidural abscesses.
\item \textbf{Congenital Anomalies}: Assessing birth defects affecting the spine.
\item \textbf{Trauma}: Evaluating injuries to vertebrae, discs, ligaments, and the spinal cord itself.
\end{itemize}
\subsection{Questions}
Explore the main sources of noise in this method and suggest some ways to deal with these problems.
\vspace{2cm}
\begin{figure}[h!]
\centering
\includegraphics[width=0.7\textwidth]{figures/pic4.jpeg}
\caption{Brain MRI}
\end{figure}
\pagebreak
\subsubsection{Causes of Noise in Brain and Spine MRI}
The causes of noise in both cases are very similar. Though it is worth separating them to see their difference as well.
\textbf{Brain MRI:}
The following are the primary sources of noise in brain MRI.
\begin{enumerate}
\item \textbf{Motion Artifacts}: Involuntary head movements, such as breathing or swallowing can cause motion-related artifacts.
\item \textbf{Thermal Noise}: Generated by random electrical fluctuations in the scanner's hardware and the thermal behavior of tissues in the brain.
\item \textbf{Magnetic Field Inhomogeneities}: Happens due to flaws in the main magnetic field, which can get worse if there are nearby metal objects like dental fillings or implants.
\item \textbf{External Electromagnetic Interference (EMI)}: Disruptions from external electronic devices or power sources can degrade image quality.
\end{enumerate}
\textbf{Spine MRI}
The following are the primary sources of noise in spine MRI:
\begin{enumerate}
\item \textbf{Motion Artifacts}: Patient discomfort while lying flat for extended periods can lead to movement which causes noise.
\item \textbf{Thermal Noise}: Similar to brain MRI, but the elongated anatomy of the spine increases susceptibility to hardware noise accumulation over the scan area.
\item \textbf{Magnetic Field Inhomogeneities}: Spine MRI is more affected due to the complex anatomy, including bones, soft tissues, and air in the thoracic region. Variations in the magnetic field occur along the spine's long axis.
\item \textbf{External Electromagnetic Interference (EMI)}: Similar to brain MRI, but has a relatively lower impact as spine imaging typically focuses on larger anatomical structures.
\end{enumerate}
\subsubsection{Approaches to Reduce Noise in MRI}
\subsubsection*{Practical Methods to Minimize Noise}
\begin{enumerate}
\item \textbf{Shielded MRI Rooms}: Equip MRI rooms with Faraday cages and magnetic shielding to reduce electromagnetic interference (EMI) from external devices and power lines.
\item \textbf{Motion Reduction}: Provide clear instructions to patients to stay still during the scan and use restraints or padding to minimize involuntary movements.
\item \textbf{Comfort Enhancements}: Ensure patient comfort (e.g., soft headrests, lumbar support) to reduce discomfort and subsequent motion.
\end{enumerate}
\subsubsection*{Algorithmic Approaches to Noise Reduction}
\begin{enumerate}
\item \textbf{Spatial Filtering}: This technique involves using filters like Gaussian or median filters to process the image. The Gaussian filter smooths the image by reducing sharp variations, which helps in minimizing random noise without losing too much detail. The median filter works by replacing each pixel's value with the median value of its neighboring pixels, effectively removing noise while preserving edges and important details in the image.
\item \textbf{Bayesian Denoising}: This method improves image quality by using prior knowledge about the characteristics of both the original signal and the noise. It applies statistical models to estimate the most likely version of the clean image, considering how the noise might have affected the original data. This approach is especially useful when the noise pattern is complex and not easily removed by simple filters.
\item \textbf{Image Averaging}: In this method, multiple images or scans of the same area are taken and then combined by averaging their pixel values. Since the actual image content remains consistent across the scans, while random noise varies, averaging helps to cancel out the noise. This results in a clearer and more detailed image, as the consistent features are reinforced, and the random noise is reduced.
\end{enumerate}
\pagebreak
\section{Filters}
In this part we learn about different filters, how they work and what’s their impact on image. Then using these filters, we denoise two given noisy images and measure how effective each filter is. We are not allowed to use built-in functions for this part.
\\ \\
In this section, we use the image below as an example.
\begin{figure}[bh!]
\centering
\includegraphics[scale=0.22]{figures/A_Calm_at_a_Mediterranean_Port.jpg}
\caption{A Calm at a Mediterranean Port | Joseph Vernet}
\end{figure}
\begin{figure}[bh!]
\centering
\includegraphics[scale=0.22]{figures/A_Calm_at_a_Mediterranean_Port_noisy.png}
\caption{Noisy Version of the Image}
\label{fig:noisy_painting}
\end{figure}
\pagebreak
\subsection{Mean Filter}
The mean filter is a smoothing technique. It works by averaging the pixel values in a local window (kernel) around each pixel, replacing the center pixel with this average. This process blurs the image slightly, making edges and details less sharp while reducing random variations. Larger kernel sizes result in stronger smoothing effects, but they also cause more loss of detail.
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_filter/k_3.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_filter/k_7.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_filter/k_11.png}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/mean_filter/k_15.png}
\end{subfigure}
\end{tabular}
\caption{Mean Filter with Different Kernel Sizes}
\end{figure}
\pagebreak
\subsection{Gaussian Filter}
The Gaussian filter is a smoothing technique used in image processing to reduce noise and blur images. It works by convolving the image with a Gaussian function, assigning higher weights to nearby pixels and lower weights to farther pixels, resulting in a smooth transition. A 2D Gaussian kernel is defined as:
$$
G(x, y) = \frac{1}{2\pi\sigma^2} e^{-\frac{x^2 + y^2}{2\sigma^2}}
$$
where:
\begin{itemize}
\item \( (x, y) \) are the coordinates of a pixel relative to the center of the kernel.
\item \( \sigma \) (sigma) is the \textbf{standard deviation}.
\item The denominator ensures the kernel sums to \textbf{1} for normalization.
\end{itemize}
\begin{figure}[h!]
\centering
\includegraphics[width=0.9\textwidth]{figures/Gaussian_kernels.jpg}
\caption{Discrete approximation of the Gaussian kernels 3x3, 5x5, 7x7}
\end{figure}
\textbf{Effects of Kernel Size}
\begin{itemize}
\item Determines the \textbf{window size} over which the Gaussian function is applied.
\item \textbf{Larger kernels} lead to \textbf{more blurring}, as more pixels contribute to the averaging.
\end{itemize}
\textbf{Effects of Sigma \( \sigma \)}
\begin{itemize}
\item Controls the \textbf{spread} of the Gaussian function.
\item \textbf{Small sigma} → Sharp details are retained, minor smoothing.
\item \textbf{Large sigma} → Strong blurring, edges are softened significantly.
\end{itemize}
\pagebreak
\begin{figure}[!h]
\centering
\resizebox{1.0\textwidth}{!}{
\begin{tabular}{cccc}
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/1.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/2.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/3.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/4.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/5.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/6.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/7.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/8.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/9.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/10.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/11.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/12.png}
\end{subfigure} \\
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/13.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/14.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/15.png}
\end{subfigure} &
\begin{subfigure}[h]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/gaussian_filter/16.png}
\end{subfigure}
\end{tabular}
}
\caption{Gaussian Filter with different kernel sizes and sigmas}
\end{figure}
\subsection{Bilateral Filter}
When we consider how the Gaussian filter works, we notice one problem: it struggles to preserve fine edges. This happens because the filter treats all neighboring pixels based only on their spatial distance from the selected pixel, without considering their brightness. To improve the filter, we can also take the brightness of the pixels into account, which helps in preserving edges while still reducing noise.
$$
\text{Gaussian: } I_{\text{filtered}}(x) = \frac{1}{W(x)} \sum_{x_i \in \mathcal{N}(x)} I(x_i) \cdot \exp\left(-\frac{\|x - x_i\|^2}{2\sigma_s^2}\right)
$$
Now if we add the brightness to our equation, we get:
$$
\text{Bilateral: }I_{\text{filtered}}(x) = \frac{1}{W(x)} \sum_{x_i \in \mathcal{N}(x)} I(x_i) \cdot \exp \left( - \frac{\| x - x_i \|^2}{2 \sigma_s^2} \right) \cdot \exp \left(- \frac{\| I(x) - I(x_i) \|^2}{2 \sigma_r^2}\right)
$$
where:
\begin{itemize}
\item \( I(x_i) \) is the intensity of the neighboring pixel at location \( x_i \).
\item \( \|x - x_i\| \) is the spatial distance between pixel \( x \) and pixel \( x_i \).
\item \( \sigma_s \) is the spatial standard deviation, controlling how much spatial distance influences the weight.
\item \( \sigma_r \) is the range standard deviation, controlling how much intensity difference influences the weight.
\item \( \mathcal{N}(x) \) is the neighborhood of pixel \( x \).
\item \( W(x) \) is a normalization factor ensuring the sum of the weights is 1.
\end{itemize}
This way the value of the current pixel will not be simply calculated based on the spatial distance, now the similarity in brightness plays a role as well. Now we apply this filter to our original image.
\vspace*{2cm}
\begin{figure}[h!]
\centering
\includegraphics[scale=0.7]{figures/bilateral_filter/1.png}
\caption{Bilateral Filtered Image (Kernel Size: 5, Sigma Intensity: 25)}
\end{figure}
\pagebreak
\subsection{Evaluation}
Evaluate the output of the three methods discussed in this section using SNR and PSNR criteria and present the results, compared with the images below in a table. Also, calculate these two criteria for the initial noisy image and declare which method performed better in noise reduction. Can you guess what kind of noise each picture has?
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/brain_mri/original.jpg}
\caption{Original Brain MRI}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/spine_mri/original.jpg}
\caption{Original Spine MRI}
\end{subfigure}
\end{tabular}
\caption{}
\end{figure}
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/brain_mri/noisy.jpg}
\caption{Noisy Brain MRI}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/spine_mri/noisy.jpg}
\caption{Noisy Spine MRI}
\end{subfigure}
\end{tabular}
\caption{}
\end{figure}
\pagebreak
First we apply each filter and see the results.
\begin{figure}[!h]
\centering
\begin{tabular}{c}
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/brain_mri/mean.jpg}
\caption{Mean Filter}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/brain_mri/gaussian.jpg}
\caption{Gaussian Filter}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/brain_mri/bilateral.jpg}
\caption{Bilateral Filter}
\end{subfigure}
\end{tabular}
\caption{Denoised Brain MRI}