Last modified by Xwiki VePa on 2025/01/08 07:41

Show last authors
1 [[image:attach:Smurfboth.png||height="250"]]
2
3 The "smurf removal" above is an example of harmonic inpainting, a method for removing unwanted objects from a photo. Let me stress that the above was not done by Photoshop! Actually Photoshop is the one that uses mathematical techniques.
4
5 Harmonic inpainting follows the ideas of Professor [[Poisson>>url:https://en.wikipedia.org/wiki/Sim%C3%A9on_Denis_Poisson||shape="rect"]], here depicted among cup lichen (genus [[Cladonia>>url:https://en.wikipedia.org/wiki/Cladonia||shape="rect"]]) using image processing methods based on deep learning:
6
7 [[image:attach:Simeon_Poisson_square2.jpg||height="250"]]
8
9 For more information about harmonic inpainting, see this [[Science SLAM Helsinki video>>url:https://www.youtube.com/watch?v=kfGcwrx_sI0||shape="rect"]].
10
11 One of the important topics in the course is the [[wavelet transform>>url:https://en.wikipedia.org/wiki/Wavelet_transform||style="text-decoration: underline;" shape="rect"]].
12
13 {{panel}}
14 **Teacher:** [[Samuli Siltanen>>doc:mathstatHenkilokunta.Siltanen, Samuli]]
15
16 **Scope:** 5 cr
17
18 **Type:** Intermediate studies
19
20 **Teaching:**
21
22 **Topics: **Mathematical modelling using matrices and linear algebra. Many practical applications with a special focus on digital image processing.
23
24 **Prerequisites: **Basic linear algebra (for example courses "Linis" I and II). Rudimentary knowledge of Matlab programming is helpful.
25 {{/panel}}
26
27 This fall the course concentrates on signal and image processing using matrix methods. The following mathematical techniques will be studied and implemented using Matlab:
28
29 * Integration by [[numerical quadrature>>url:https://en.wikipedia.org/wiki/Numerical_integration||shape="rect"]],
30 * Fourier series and [[Fast Fourier Transform (FFT)>>url:https://en.wikipedia.org/wiki/Fast_Fourier_transform||shape="rect"]],
31 * [[Wavelet transform>>url:https://en.wikipedia.org/wiki/Wavelet_transform||shape="rect"]], both in 1D and 2D.
32
33 We will collect data with **smartphone sensors and cameras**, and make sense of the data using matrix computations. For example, we will use wavelets for removing noise from the signals and compressing images. There are close connections to JPEG and JPGE2000 image formats, which are based on cosine transform and wavelet transform, respectively.
34
35 This course will prepare the students for using computational mathematics both in scientific research and in work life outside the university.
36
37 {{toc maxLevel="4" minLevel="2" indent="20px"/}}
38
39 == News ==
40
41 18.10.2016 Results of the feedback questionnaire are in. It seems that the course has been pretty OK:
42
43 [[image:attach:Feedback.png]]
44
45 9.9.2016: Results of the background questionnaire are in. This is the distribution of students according to major topic:
46
47 [[image:attach:Screen Shot 2016-09-09 at 14.31.24.png||height="250"]]
48
49 Here are the answers to the questions:
50
51 [[image:attach:Screen Shot 2016-09-09 at 14.32.49.png||height="400"]]
52
53
54
55 ----
56
57
58
59 == Teaching schedule ==
60
61 Weels 36-41, Wednesdays 10-12 and Fridays 12-14 in auditorium CK112. Two hours of exercise classes per week.
62
63 == Exams ==
64
65 There is no exam. The course is passed by returning answers and solutions to weekly exercises.
66
67 ----
68
69
70
71 == Course material ==
72
73 The course material will be uploaded to this page as the course progresses. The material includes lecture notes and Matlab programs.
74
75 (% style="color: rgb(255,0,0);" %)**[[image:attach:Uuzi.gif]]Lecture 12**(% style="color: rgb(0,51,102);" %) (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)(October 19, 2016)
76
77 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Experiments with the 2D wavelet transform. Especially: compression of images.
78
79 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)[[image:attach:MatlabLogoSmaller.png]][[attach:wavetrans2Donce.m]], [[attach:wavetrans2Donce_inv.m]], [[attach:wavetrans2D.m]], [[attach:wavetrans2D_inv.m]], [[attach:Wavelet_tr2D_test.m]]
80
81 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0)" %)**Lecture 11**(% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0); color: rgb(0, 51, 102)" %) (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0); color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)(October 14, 2016)
82
83 Explanation of the orthogonal basis of the space L^2([0,1]) provided by Haar wavelets.
84
85 Structure of the 2D wavelet transform.
86
87 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0)" %)**Lecture 10**(% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0); color: rgb(0, 51, 102)" %) (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0); color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)(October 12, 2016)
88
89 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Finishing the implementation of the multi-scale wavelet transform. Here are the transform files:
90
91 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)[[image:attach:MatlabLogoSmaller.png]] [[attach:Wavelet_tr_onestep.m]], [[attach:Wavelet_tr_inv_onestep.m]], [[attach:Wavelet_tr.m]], [[attach:Wavelet_tr_inv.m]].
92
93 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)We tested the transform with three different signals:
94
95 * (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Synthetic signal with step discontinuities and added noise,
96 * (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Acceleration signal recorded with a smartphone and Matlab Drive ([[attach:lecture_acc.mat]]),
97 * (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Sound signal recorded in the lecture ([[attach:Wtrans.m4a]], [[attach:Wtrans.mat]]).
98
99
100 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)The signal files are available above. Here is the test routine.
101
102 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)[[image:attach:MatlabLogoSmaller.png]] [[attach:Wavelet_tr_test.m]]
103
104 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)This picture shows the result of noise reduction using Haar wavelets:
105
106 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)[[image:attach:noisereduction.png||height="400"]]
107
108
109 (% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0); color: rgb(255, 0, 0)" %)**Lecture 9**(% style="color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)** **(October 7, 2016)
110
111 (% style="color: rgb(255, 0, 0); color: rgb(0, 51, 102); color: rgb(0, 0, 0)" %)Programming the one-dimensional multi-scale wavelet transform. It was not quite completed as the multi-scale part of the inverse transform is still in construction.
112
113 (% style="color: rgb(255,0,0);" %)**
114 **
115
116 (% style="color: rgb(255,0,0);" %)**Wednesday, October 5, 2016: no lecture due to sick leave! **
117
118
119
120 (% style="color: rgb(255,0,0);" %)**Lecture 8**(%%) (September 30, 2016)
121
122 Motivational introduction to [[wavelets>>url:https://en.wikipedia.org/wiki/Wavelet||shape="rect"]] and the amazing [[Wavelet Transform>>url:https://en.wikipedia.org/wiki/Wavelet_transform||shape="rect"]], both in 1D and 2D. The 2D transform looks like this:
123
124 [[image:attach:China512.jpg||height="250"]] [[image:attach:China512tr.jpg||height="250"]]
125
126 The wavelet transform is useful for removing noise from images as well as for compressing images. The JPEG2000 standard uses wavelets.
127
128
129
130 (% style="color: rgb(255,0,0);" %)**Lecture 7**(%%) (September 28, 2016)
131
132 Complex formulation of Fourier series. See [[attach:FourierSeries_v1.pdf]].
133
134 Filtering of signals by setting some of the coefficients to zero (low-pass, high-pass, band-pass filters).
135
136 Speeding up the computation by replacing silly for-loops by the legendary [[Fast Fourier Transform>>url:https://en.wikipedia.org/wiki/Fast_Fourier_transform||shape="rect"]] (FFT).
137
138 [[image:attach:MatlabLogoSmaller.png]] [[attach:Fourierseries_complex_test.m]], [[attach:Fourierseries_realsound_test.m]] (slow with for-loops), [[attach:Fourierseries_realsoundFFT_test.m]] (fast with FFT)
139
140 The sample sound is available here: [[attach:testsound.m4a]]
141
142
143
144 (% style="color: rgb(255,0,0);" %)**Lecture 6**(%%) (September 23, 2016)
145
146 Lecture given by Santeri Kaupinmäki. Topics covered:
147
148 * Markov chains
149 * Ranking webpages (Note: [[Perron-Frobenius theorem>>url:https://en.wikipedia.org/wiki/Perron%E2%80%93Frobenius_theorem||shape="rect"]] guarantees a unique ranking vector)
150
151 Also showed examples of linear regression, markov chain, and webpage ranking in MATLAB.
152
153 [[image:attach:MatlabLogoSmaller.png]][[attach:DataFitExample1.m]]
154
155 [[attach:TeleOperatorComputation.pdf]]
156
157 [[~[~[image:attach:MatlabLogoSmaller.png~]~]>>attach:TeleOperatorComputation.m]][[attach:TeleOperatorComputation.m]]
158
159 [[image:attach:MatlabLogoSmaller.png]][[attach:FivePageInternet.m]]
160
161
162
163 (% style="color: rgb(255,0,0);" %)**Lecture 5**(%%) (September 21, 2016)
164
165 Lecture given by Santeri Kaupinmäki. Topics covered:
166
167 * [[Linear least squares>>url:https://en.wikipedia.org/wiki/Linear_least_squares_%28mathematics%29||shape="rect"]]
168 * [[Linear regression>>url:https://en.wikipedia.org/wiki/Linear_regression||shape="rect"]]
169 * [[Singular value decomposition>>url:https://en.wikipedia.org/wiki/Singular_value_decomposition||shape="rect"]] (and its application for the minimum norm solution of the linear least squares problem)
170
171 The file [[attach:LeastSquaresStuff_v2.pdf]]contains notes on the least squares method and SVD, as well as a proof of the SVD approach to the minimum norm solution in Theorem 4.1.
172
173
174
175 (% style="color: rgb(255,0,0);" %)**Lecture 4**(%%) (September 16, 2016)
176 Computational study of Fourier series approximation of functions. Quick conclusions: (1) for a continuous periodic function, a small number of Fourier modes is enough for approximation with high accuracy, and (2) approximating a discontinuous function using Fourier series needs a large number of Fourier modes to avoid "[[Gibbs phenomenon>>url:https://en.wikipedia.org/wiki/Gibbs_phenomenon||shape="rect"]]," or rapid oscillations near the discontinuity.
177
178 [[image:attach:MatlabLogoSmaller.png]] [[attach:Fourierseries_test.m]]
179
180 Introduction to the source-filter theory of vowel sounds in human speech. Lecture notes (without videos): [[attach:HumanVoice_v2_share.pdf]]
181 For the videos, see [[https:~~/~~/www.youtube.com/watch?v=Tw2pYY9g6QM>>url:https://www.youtube.com/watch?v=Tw2pYY9g6QM||shape="rect"]]
182
183 During the lecture, we recorded the sound of the [[Electrolarynx>>url:https://en.wikipedia.org/wiki/Electrolarynx||shape="rect"]], and analysed the signal using Fourier series. Here is the data file and Matlab routine for you to download:
184
185 [[image:attach:MatlabLogoSmaller.png]] [[attach:glottal_excitation.m4a]], [[attach:Fourierseries_glottal.m]]
186
187 Please try the following: approximate the excitation signal using N values 100, 200, 300, 400, 500 and 600. After each computation, listen to the result:
188
189 ~>> sound(sgnl,FS);sound(fseries,FS)
190
191 (% style="color: rgb(255,0,0);" %)**
192 **
193
194 (% style="color: rgb(255,0,0);" %)**Lecture 3**(%%) (September 14, 2016)
195
196 (% style="line-height: 1.42857;" %)Numerical integration using quadrature rules.
197
198 * [[Midpoint rule >>url:https://en.wikipedia.org/wiki/Rectangle_method||shape="rect"]](essentially the technique discussed in the lecture)
199 * [[Trapezoidal rule>>url:https://en.wikipedia.org/wiki/Trapezoidal_rule||shape="rect"]]
200 * [[Simpson's rule>>url:https://en.wikipedia.org/wiki/Simpson%27s_rule||shape="rect"]]
201 * [[Gaussian quadrature>>url:https://en.wikipedia.org/wiki/Gaussian_quadrature||shape="rect"]]
202
203 [[image:attach:MatlabLogoSmaller.png]][[attach:quadrature_tests.m]], [[attach:gaussint.m]] (this gaussint.m routine is written by Addie Lambert)
204
205 Introduction to Fourier series. Lecture notes: [[attach:FourierSeries_v1.pdf]]
206
207
208
209 (% style="color: rgb(255,0,0);" %)**Lecture 2**(%%) (September 9, 2016)
210
211 Opening and saving jpg image files in Matlab. Applying gamma correction to brighten or darken the image.
212 [[image:attach:MatlabLogoSmaller.png]][[attach:open_image_in_Matlab.m]], [[attach:gamma_correction.m]]
213
214 [[image:attach:lecture.jpg||thumbnail="true" width="50"]] [[attach:lecture.jpg]]
215
216 Removing unwanted objects from photographs using harmonic inpainting. Lecture notes: [[attach:Inpainting_v1_share.pdf]]
217
218 [[image:attach:MatlabLogoSmaller.png]][[attach:Poisson_FD_solve.m]], [[attach:FD_Laplace.m]]
219
220 [[image:attach:Smurf.jpg||thumbnail="true" width="50"]] [[attach:Smurf.jpg]]
221
222
223
224 (% style="color: rgb(255,0,0);" %)**Lecture 1**(%%) (September 7, 2016)
225
226 Overview of the course
227 Background questionnaire: [[attach:Taustatietolomake.pdf]]
228 Introduction to applications of matrix computations: [[attach:CourseIntroduction.pdf]]; regarding the drum shapes, see
229 [[https:~~/~~/www.youtube.com/watch?v=SIOLRcU7FZo>>url:https://www.youtube.com/watch?v=SIOLRcU7FZo||shape="rect"]] 
230 Case study: X-ray tomography and matrices. See [[attach:TomographyIntro_v9_share.pdf]] and the following video:
231 [[https:~~/~~/www.youtube.com/watch?v=eWwD_EZuzBI>>url:https://www.youtube.com/watch?v=eWwD_EZuzBI||shape="rect"]]
232
233 ----
234
235
236
237 == [[Registration>>url:https://oodi-www.it.helsinki.fi/hy/opintjakstied.jsp?html=1&Tunniste=57079||shape="rect"]] ==
238
239
240 (% style="color: rgb(96,96,96);" %)Did you forget to register? (%%)[[What to do?>>doc:mathstatOpiskelu.Etusivu.Kysymys4.WebHome]]
241
242 == Exercises ==
243
244 You gain credits from this course only by completing the weekly exercises; there is no exam. Every exercise will have six questions worth six points each. To receive a grade for the exercises send a **single pdf-file **(no other formats are accepted!) written with your favourite text-editing program and** containing your matlab codes (as text), results, images, comments and explanations** to the e-mail address [[application.matrixcomputation@gmail.com>>mailto:application.matrixcomputation@gmail.com||rel="nofollow" shape="rect" class="external-link"]] **by Monday 10 a.m**. **after the exercise week** (for ex. by 10 a.m. on the 19th of September for Exercise 1). Please write the answers in **English **or** Finnish**.
245
246 Please write in the text of your e-mail which tasks are included in your solution (for ex. //Hi! I am sending my solutions to tasks 1, 2, 3, and 5 in the 1st exercise round. Best wishes, Mary Math//). Max number of pages is limited to 15. The assistants will **not** reply to the e-mails; if you have questions related to the exercises, send them as separate e-mails directly to the exercise assistants (usual helsinki.fi-addresses).
247
248 [[image:attach:Uuzi.gif]] **The grading will be decided at the end of the course, but you are guaranteed to pass the course if you get at least 40% of the available exercise points.**
249
250
251 The exercise groups are for getting advice from an assistant in solving the exercise problems (participating the exercise class is not obligatory).
252
253 The exercise assistants are Santeri Kaupinmäki and Jonatan Lehtonen.
254
255
256
257 [[image:attach:Uuzi.gif]] [[Results for all exercises>>url:https://docs.google.com/spreadsheets/d/1wsDgQgoPdBBtF8WWBiaA9x5hHXK8UKt-z8iKZnwRA7w/pub?gid=1995404979&single=true&output=pdf||shape="rect"]] (If your results are missing, please contact the exercise assistants by email.)
258
259
260
261 [[attach:Exercise06.pdf]] (Some tips for exercise 1 were added on Monday 17.10.)
262
263 [[~[~[image:attach:MatlabLogoSmaller.png~]~]>>attach:DCT_testing.m]][[attach:wavetrans2Donce.m]], [[attach:wavetrans2Donce_inv.m]], [[attach:wavetrans2D.m]], [[attach:wavetrans2D_inv.m]]
264
265
266
267 [[attach:Exercise05.pdf]] (Some tips for exercise 1 were added on Friday 07.10.)
268
269 Here is material for learning the concept of one-dimensional convolution: [[attach:Convolution.pdf]]
270
271 [[~[~[image:attach:MatlabLogoSmaller.png~]~]>>attach:DCT_testing.m]] [[attach:DCT_testing.m]], [[attach:HaarTransform.m]], [[attach:HaarTransformFilter.m]], [[attach:HaarTransformMatrix.m]], [[attach:Tokyo256.mat]], [[attach:TokyoRow.m]]
272
273
274
275 [[attach:Exercise04.pdf]]
276
277 [[image:attach:MatlabLogoSmaller.png]][[attach:FFTdemo2D.m]]
278
279 [[image:attach:BigBen.jpg||thumbnail="true" height="150"]] [[attach:BigBen.jpg]]
280
281
282
283 [[attach:Exercise03.pdf]]
284
285 [[~[~[image:attach:MatlabLogoSmaller.png~]~]>>attach:kissa.m]][[attach:kissa.m]],[[attach:DataFitExample1.m]]
286
287 [[attach:TeleOperatorComputation.pdf]]
288
289 [[attach:Exercise02_v2.pdf]]
290
291 [[image:attach:Ladybug.png]][[attach:Ladybug.png]]
292
293 [[image:attach:Ladybug2.png]][[attach:Ladybug2.png]]
294
295
296
297 [[attach:Exercise01.pdf]]
298 Note that the biological errors in Problem 6 have been corrected on September 9, 2016! Namely, flies have 5 eyes and rattlesnakes have two horns.
299 However, if you return an answer to the original form of the exercise, it's OK.
300
301 === Assignments ===
302
303 === Exercise classes ===
304
305 |=(((
306 Group
307 )))|=(((
308 Day
309 )))|=(((
310 Time
311 )))|=(((
312 Room
313 )))|=(% colspan="1" %)(((
314 Instructor
315 )))
316 |(((
317 1.
318 )))|(((
319 Mon
320 )))|(((
321 12-14
322 )))|(((
323 C128
324 )))|(% colspan="1" %)(((
325 Santeri Kaupinmäki
326 )))
327 |(((
328 2.
329 )))|(((
330 Wed
331 )))|(((
332 14-16
333 )))|(((
334 C128
335 )))|(% colspan="1" %)(((
336 Jonatan Lehtonen
337 )))
338 |(((
339 3.
340 )))|(((
341 Thu
342 )))|(((
343 10-12
344 )))|(((
345 C128
346 )))|(% colspan="1" %)(((
347 Santeri Kaupinmäki
348 )))
349 |(% colspan="1" %)(((
350 4.
351 )))|(% colspan="1" %)(((
352 Fri
353 )))|(% colspan="1" %)(((
354 14-16
355 )))|(% colspan="1" %)(((
356 C128
357 )))|(% colspan="1" %)(((
358 Jonatan Lehtonen
359 )))
360
361 == Course feedback ==
362
363 Course feedback can be given at any point during the course. Click [[here>>url:https://elomake.helsinki.fi/lomakkeet/11954/lomake.html||style="line-height: 1.4285;" shape="rect"]].
364
365