It can be seen here that FFT becomes smaller as the image becomes larger, which is consistent with the theoretical expectations. FT was also performed in the letter A shown below:
For part B of the activity we obtained the convolution of 2 images. One image serves as the "aperture" and the other serves as the "object." Taking the convolution of this two objects is similar to obtaining the "image" of the "object" using the "aperture" as a "lens." The following results are obtained for a small aperture
For a larger aperture, the results show that we are able to reconstruct a better image. However, we are still not able to obtain perfect reconstruction as seen in the image because the color of the image is not similar to the original.
For part C of the activity, we are to obtain the correlation of the a letter in a long sentence. We are to find the correlation of the letter "A" in the phrase "THE RAIN IN SPAIN STAYS MAINLY IN THE PLAIN." I used Arial font size 16, boldface for this part, the following is the code that I used:
-------------------------------------------------------
S = imread("C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6C\sentence3.bmp");
A = imread("C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6C\A3.bmp");
grayS = im2gray(S);
grayA = im2gray(A);
fftS = fft2(grayS);
fftA = fft2(grayA);
mul = fftA.*conj(fftS);
inve = fft2(mul);
scf(1);imshow(grayS);
scf(2);imshow(fftshift(abs((inve))),[]);
-------------------------------------------------------
I obtained the following result for the same sized A,
For the last part of the activity, we performed edge detection on the word VIP using different patterns. I used the patterns suggested by Dr. Soriano, which are horizontal, vertical diagonal and spot.




-------------------------------------------------------------------
VIP = imread("C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6d\T.bmp");
VIP = im2gray(VIP);
pattern1 = [-1 -1 -1;2 2 2; -1 -1 -1];
pattern2 = [-1 2 -1; -1 2 -1; -1 2 -1];
pattern3 = [2 -1 -1; -1 2 -1; -1 -1 2];
pattern4 = [-1 -1 -1; -1 8 -1; -1 -1 -1];
corre1 = imcorrcoef(VIP,pattern1);
corre2 = imcorrcoef(VIP,pattern2);
corre3 = imcorrcoef(VIP,pattern3);
corre4 = imcorrcoef(VIP,pattern4);
imwrite(corre1,"C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6d\hori.bmp");
imwrite(corre2,"C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6d\vert.bmp");
imwrite(corre3,"C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6d\diag.bmp");
imwrite(corre4,"C:\Documents and Settings\Semicon.POSITRON\Desktop\activity6\6d\spot.bmp");
scf(0);imshow(corre1, []);
scf(1);imshow(corre2, []);
scf(2);imshow(corre3, []);
scf(3);imshow(corre4, []);
The following results were obtained for "VIP":
I will give myself a grade of 10 because I believe I was able to do all the required task and also I was able to completely explain the results.
Abraham Latimer Camba Helped me in this activity
1 comment:
I liked that you did try out an experiment which was not part of the activity - the part where you tried what to see what happens if you reduce the font size of A. For this you deserve an 11.
Post a Comment