Familiarization with discrete FFT
Scilab has a function for 2 dimensional FT. This was explored and the results are shown in Figure 1.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixGiS2JJZc2Xvy1uApSZB0HN1Jh6IeHQagEvmEmDKk20VYp0mbWn5C6SQnBas97gipoLbvrigQxPuP3mMVrtfjdp2_1Xo2B2DhPCKce48SqHFK6M7zd_6sCyftQPxyBGF5uuhszhK-UJAe/s200/absfft.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_BCDiYiPsCB_zgTDzlgG5YrW7hby_LLFriNR1HTEnl0raGo2pjHINOiSY9tVNYx7Vzn8RQwD8Mh871TwiC9iNuXNEAfnreNAga-5aay6oPqlfrkEmsMOwgJflx-0t9DwVNvJ_WZyFu9D8/s200/shiftfft.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha_YPY-3_GlJ0vX5b3302jWF5ZucyJ1fhx-2Hef0pTLhKETsZqIHUhoHJ5NH19AjaNq1L6ebB-WkTNBugnsvztmPCA4vSgdMgigD1X71BvnBu0mKPU0F3-7glTSFRfm2DM70JMNuG3535e/s200/fftfft.gif)
Figure 1. (From left to right) Output for (a) intensity of fft, (b) shifted fft, (c) fft applied twice.
It is seen in Figure 1b that the output of the shifted FT of the circle matches the analytical FT of a circle which is an Airy pattern.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6RoOtUmoHvHGcXpIRMJ7CyddC51MCSV1hZHtIBuFnDcqGJ-1-M6pIPP_bKYOmcO8KmPiGxGXzF6am7lLy-dXpPyska-C_XAhU3rhLKucDnFvKZ14LyU8gAglezX5tD57boV-a_dk4iub6/s200/Aabsfft.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv2zWhsts0qlrSILCMCSE_ML2txowFcTberysjtqgmk84NAQo8hemMbBWKaYf2WGtrlLesMq9fLr-aUDJWL3lOgf-tgLG-Z3-8UgqDbW9t8doCqxRNAuV-u8oinYLNavWlmlZXzvaVmnl7/s200/Ashiftfft.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyq5hl4cp6sFw-h5daiD3bj1DJrLxzDBVKcrTyM7FJxFUiQYMrra8h98qjkD8D3quMIgOJFLGtUxGI70nybc4Ssgf6Uv5OEKGYrnu7hBzDYoypRNtxl2oicQmYIgcp4U9eubN_QEFNd7FZ/s200/Afftfft.gif)
Figure 2. (From left to right) Output for (a) intensity of fft, (b) shifted fft, (c) fft applied twice.
The same procedure was done to a image of the letter A. It is seen that applying the fft twice results to an inverted version of the original image. This is because the result of fft2 has the quadrants along the diagonals interchanged.
Simulation of an imaging device
A digital camera has a lens with a finite size. This means that it could only gather a limited number of rays from the object resulting to a reconstruction that is not perfect. This phenomenon is illustrated here.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfJnJ-rL7JUievqEgh2BV74iRSvymXsW0IYLmiDhp7WvDa6kwfZi7CtE0r7wLINw8R5JvUAf1KX6N5aTVz8c7gR0H94fYNfz2g1SfdU9IQZefX7Qokt2zSf4P1C-H1pGepfKshk3bXdRS5/s200/vip.bmp)
Figure 3. Original image simulating the object to be imaged.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO3TWuYKD30XsPSMfUN3-vUF2jAYItiAYVLgfMtvgnYidH5yccqgAkl8cgpyJr6Pj3cac26aTIjF_8ZpWs_7bu_0GM-h2A2ioOP_0U6ZWE6DMVF4lT9BZ2AWAhY-HSaU7MC5feWxaHc6Nf/s200/est.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwI3E90ENWoqvqaY2Z29od0AM3QJeTlU8JJ9qIhKNHUspd6RURIxHZq_QaS5ubga2HBlJFlPaUmvyhJWJo97G_YtUrYNBizbZB2QQ199Gwo3Zp4C28-1QVksJqcDCkh7Zi66ABmhtRetPP/s200/small.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNXU6VSspmE31OpN_4-6ek3h5MkckIQOs-j4NJhYNgjWBYcGajJt8pNifTeqDMJk2bpWIaV5iI-zg-GST6cvrTe5BsMjM4fkxlQFYjeQLvzlGL6iwrH8WRbyDDnqQPdx9iwwDqMsSkOk11/s200/medium.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD7DTTXRbJY0T-1o6f8zEuJgRBYLvyGNuzDNxW8fWJYpF4aFXfSCu28RE_qq-kPyExmhjfZYp7ZH5ETuDJ5kUVnElyQuL06KyNtGu5Gb4rFCeUzoGQFf0ZVzzcQADqkX09wOU1TypEwapB/s200/large.gif)
Figure 4. (From left to right) The "imaged" "VIP" for radii of increasing size.
The “imaged” “VIP” becomes closer to the original “VIP” with increasing radii of the white circle. This means that the larger the aperture of the lens, the higher the quality of the image.
Template Matching Using Correlation
Correlation measures the degree of similarity between two functions or images at that. The more similar they are at a certain position, the higher their correlation. This makes the correlation function very useful in template matching and pattern recognition.
Template matching is a pattern recognition technique used in identifying the common patterns in a scene such as a word or an image. This technique is applied to a text and the results are shown in Figure 5.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmKG-PH1KEFqIpaL8CaFbvPHqJPGdPscnlLxWT2tThpgXdos3D1eiK2vaXZqmEnHzF4DkHose6jgmxZZthcubDCoy4LZ2pFvzRk3Nd6nTR91utxOBSUQS3UveTB-FuSLEaU1thsmYbXWrD/s200/rain.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqbHnYJHe4FmdD2q4Bq9UXZUvki2WG9B1tq7IyGS3WQKvPo-1UQ3OA5640UPU4TUvru05H6DW9bbwcaao7gQn-lFl3M8Pf4jaTPknOQvuHBmbMOUKlfI0aX-RC-kO1KZuLXvRjsIh9nrOr/s200/Arain.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUyzvzPQ99oTDoGQ0pYGcMXf-Hs3bU0tms0cDxjYFdWxZR5kMT9Fot-IfXwItKK605aVLwjZjxn65qEAgsYg5p24e1mg85Hv_Wov9_Lpn7m3p7kSDOuwCsgS0DhKJKbxc01Nxzyn-DWRTZ/s200/corr.gif)
Figure 5. (From left to right) The first image is the text, the second is the letter "A" that we will find in the text, the third image shows the result after using the correlation function.
The result after using the correlation function is a map that lights up at the positions where we find the letter "A" in the text. Indeed we are able to find the identical patterns in this particular scene.
Edge detection using the convolution integral
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaOmQ2bfNgQf7j_QEn6A4ZC7OXWqN87HhSsp4ydD8ZQTnAs7JTBMH7KoMH3kzzyoYMQFTUkdsPzJW4eVu2T_ibvuEsWbTHkuozm0_mS-swhJm_q0anPJPpZwPCtSvkCVonlLeuDJ8bFNW3/s200/hori.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKee-4L-P4JsO0JVYAwBnWkbntRZBZZu00wZtoWw-WZVmWba9ZP2aAPqW1nMu71qqyCYagndiM_dPivAnBGMs_vXOGwaqs-0oouF-ggLU1MMGopqcNL31KRV4FsDfFGtV_ZUPaZp2ETtHS/s200/poin.gif)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2C7W7lrb7EEO2_e9mStHLS_WwH0O7BCQvrXE377X2Qm5rwCsGSpeeAZl3liIG1KltC8tCngAQ1KTZ6WRwBuJyQB4CD6QXO_jhvXZJs30Vb8eZkVOQUz72LjTJ0wE5oYX7kzs40zEDaFiZ/s200/verti.gif)
Figure 6. (From left to right) Edge detection using a horizontal pattern, using a point pattern, and using a vertical pattern.
The convolved image for various patterns indicates the edges which are characterized by the pattern. The horizontal pattern makes all the horizontal edges light up, The point pattern makes the whole edge light up and the vertical pattern makes the vertical edges light up. Convolution is a very useful technique for edge detection.
For this activity, I give myself a grade of 10 because I implemented all the sub-activities and I learned and implemented various image processing techniques.