Wednesday, 24 February 2016

HW 1 (CH 3) - Spatial Filtering

HW 1 (CH 3) - Spatial Filtering ( Smoothing and Sharpening)
Due: 2 March 23:59, 2016

Create a MATLAB function that :

  • Takes a path to a grayscale image,
  • Finds blurred image of the given image employing a 6x6 averaging filter (larger than Fig. 3.32 (a) )
  • Finds gradient image of the given image by applying Sobel operators (see Fig. 3.41 (d-e) ) and Eq. 3.6-11,
  • And displays both images.
Note: Your gradient image might not be in the defined color range. So, you can normalize it or display it with imagesc() function.
For convolution, you can use conv2 function.

Matlab Introduction - My command history

I have demonstrated few tips in MATLAB. Here is my command history:

 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
%-- 22/2/16 4:20 PM --%
clear
clc
pwd
cd '..'
pwd
cd '~/Desktop/Digital Image Processing/Course documents/'
mkdir('matlab')
dir
cd matlab/
dir(..)
dir('..')
I = imread('../parrots.jpg');
imshow(I)
ones(3)
Ir = ones(50)*255;
Ig = ones(50)*255;
Ib = zeros(50)*255;
clearvars I
I(:,:,1) = lr;
I(:,:,1) = Ir;
I(:,:,2) = Ig;
I(:,:,3) = Ib;
Ipr = imread('../parrots.jpg');
imshow(I)
imshow(uint8(I))
Ifurkan = I/2;
Ifurkan(1:3,1:3,1)
imshow(Ifurkan)
figure,imshow(I)
imshow(uint8(Ifurkan))
doc imshow
imshow(rgb2gray(Ipr),[0.8 , 0.9])
imshow(rgb2gray(Ipr),[0.5 , 0.9])
imshow(rgb2gray(Ipr),[0.1 , 0.9])
imshow(rgb2gray(Ipr),[100 , 200])
doc image processing
imshow(Ipr)
Igr = rgb2gray(Ipr);
imshow(Igr)
imhist(Igr)
Ihe = histeq(Igr);
imshow(Ihe)
imhist(Ihe)
f = Ihe(100,:);
plot(f)
stem(f)
F = fft(f);
stem(f);figure,stem(F)
F(1:5)
stem(abs(F))
close all
stem(abs(F))
t=linspace(0,1,100);
c = cos(2*pi*t);
stem(c)
c = cos(2*pi*t*30);
stem(c)
c2 = cos(2*pi*t*20);
c3 = cos(2*pi*t*5);
call = c+c2+c3;
stem(call)
stem(abs(fft(call)))

Wednesday, 17 February 2016

Chrome's affine transform error

Today, I was looking for something in my laptop and came across warning messages produced by chrome (see the image). See the last error. Now, you should have an idea about the error because we talked about affine transform matrices.

I showed you how to find new pixel locations after the transformation, however, didn't tell you that it is more convenient to find the target image's pixel locations in the current image. That is, I showed you that:

\[AT=B\] but actually what is used in applications is this: \[A=BT^{-1}\]  So, the error in the message list stems from trying to take the inverse of \(T\) where \(T\) is singular for some reason.

(Remember, A or B is not pixel values of the image. It is a 3 column matrix with first and second columns are coordinates and the last column is the pixel value.)


Wednesday, 3 February 2016

Lecture Slides

Slides can be downloaded from my gdrive:

https://drive.google.com/open?id=0B2gHM0DbKAwpanZrVDBTZ3EyU0E

I will add new ones as I change them.

Syllabus

ECE 559 - Digital Image Processing


Lecturer: Dr. Kasım Taşdemir



Quantity
Weight %
Homework Assignments
8
40
Midterm
1
30
Final
1
30


Weekly schedule:


  1. Overview of Digital Image Processing applications,
  2. Image sampling and quantization, Relation of the pixels,
  3. Intensity transformations, histogram processing, spatial filters Fourier transform of sampled functions, Discrete Fourier Transform (DFT) and
  4. properties of 2D DFT,
  5. Filtering in frequency domain
  6. Filtering in frequency domain (Continued)
  7. Image restoration and reconstruction
  8. Midterm Exam
  9. Image reconstruction from projections
  10. Wavelets and multiresolution processing,
  11. Wavelets and multiresolution processing (Continued)
  12. Morphological operations
  13. Image segmentation and thresholding
  14. Introduction to pattern recognition
  15. Course Review
  16. Final Exam


Textbook:
  • Rafael C. Gonzalez, “Digital Image Processing”, Prentice Hall, 3rd edition, 2008


RECOMMENDED BOOKS:


  • Gonzalez, et al., “Digital Image Processing Using MATLAB”, Gatesmark Publishing, 2nd edition, 2009
  • William K. Pratt, “Digital Image Processing: PIKS Scientific Inside”, Wiley, 4th edition, 2006,
  • Edward R. Dougherty, “Random Processes for Image Signal Processing”, Wiley, 1998


Schedule:



Mon
Tue
Wed
Thu
Fri
9:00

Seminar Room A


10:00





11:00






Homework 0 - Scale up an image using interpolation


Due date: 15/02/2016 23:59 (After that, Elvis will left the building.)
Upload location: (will be provided later)


Ordinary HW:

Create a MATLAB function which takes one argument:

  1. Path to an image, e.g., "c:\\smiley.bmp"
and triple the size of the image and display it. Use nearest neighbor interpolation

Note: You can convert the image to a grayscale one in order not to deal with a 3D matrix. You are not allowed to use off-the-shelf MATLAB functions for zooming. The point of the HW is to implement a zooming and interpolation method. You can use MATLAB functions for other purposes, e.g., I = imread("c:\\smiley.bmp");

Bonus +50%:


via GIPHY

To make the function support any zoom amount, make the function take two arguments, one is the path as in ordinary HW, the other one is:
     2.  An integer indicating the desired amount of zoom, e.g., 5
And use bilinear interpolation.

Bonus + Lefting the lecturer speechless:

Do all the above and also support zooming in fractions, e.g., zoom: 3.42.

Good luck,
Kasım
-----------

Have a look at these:

https://en.wikipedia.org/wiki/Linear_interpolation
https://en.wikipedia.org/wiki/Image_scaling