Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE465 Midterm Review Mar. 23, 2010. MATLAB-based Midterm Exam Research-oriented learning Just like MATH, MATLAB is another tool (use it wisely) All Roads.

Similar presentations


Presentation on theme: "EE465 Midterm Review Mar. 23, 2010. MATLAB-based Midterm Exam Research-oriented learning Just like MATH, MATLAB is another tool (use it wisely) All Roads."— Presentation transcript:

1 EE465 Midterm Review Mar. 23, 2010

2 MATLAB-based Midterm Exam Research-oriented learning Just like MATH, MATLAB is another tool (use it wisely) All Roads Lead to Rome The principle of finding out the answers is applicable to other engineering disciplines I hope it will be a FUN experience

3 Logistics Part I (10  6=60 points) –Test correct understanding of basic DIP concepts and flexible use of MATLAB tools Part II (10  6=60 points) –Test correct understanding of basic DIP algorithms and their MATLAB implementations Part III (20  3=60 points) –Test advanced problem solving skills under MATLAB

4 Part I Image-related basics –Spatial resolution, bit-depth resolution, color channels, basic matrix-related operations under MATLAB Image acquisition –sampling and quantization, CCD vs CMOS, Bayer pattern, color demosaicing Image perception –Brightness vs. lightness, optical illusions

5 EE465: Introduction to Digital Image Processing 5 Bit-depth Resolution If you want to hide something into an image, which bitplane is appropriate?

6 EE465: Introduction to Digital Image Processing 6 Block-based Processing Are you good at the puzzle?

7 EE465: Introduction to Digital Image Processing 7 Sampling and Quantization(1D)

8 EE465: Introduction to Digital Image Processing 8 2D Sampling and Quantization

9 EE465: Introduction to Digital Image Processing 9 3D Visualization of an Image Which Matlab function does 3D visualization?

10 Color Imaging: Bayer Pattern EE465: Introduction to Digital Image Processing 10 US3,971,065 $38,990 $309 Why do we want Bayer pattern and why green is more densely sampled?

11 Demosaicing (CFA Interpolation) EE465: Introduction to Digital Image Processing 11

12 EE465: Introduction to Digital Image Processing 12 Another Lightness Illusion You will verify that A and B have exactly the same value in CA3.

13 EE465: Introduction to Digital Image Processing 13 Optical Illusions

14 $500000 Which of the following statement is NOT true? –A) Fourier transform of a Guassian function is still Gaussian –B) Histogram equalization is a nonlinear operation –C) Median filtering is NOT translation invariant –D) The total number of green pixels in a Bayer pattern is twice as many as that of red or blue ones

15 $1000000 Which of the following pair of matlab codes is NOT equivalent to each other? –A) y=imnoise(x,’gaussian’,0,0.1) vs. y=x+randn(size(x))*0.1 –B) imshow(x/255,[]) vs. imshow(x/1000,[]); % x is an image in double format –C) imresize(x,2) vs. interp2(x,2) –D) for i=1:length(x);if x(i)>128; x(i)=1;else x(i)=0; end;end; vs. x=(x>128);

16 Part II Image-related algorithms –Interpolation (imresize, interp2, griddata) Replication, bilinear, bicubic, spline, advanced* (ESI, NEDI) –Denoising (imnoise, medfilt2, filter2, imfilter) Salt & pepper vs. Gaussian vs. periodic, Hammer- Nail match –Deblurring (please see deblurring.zip) Why do we need FT? How to avoid divided-by- zero? –Edge detection (edge, bwareaopen*, belabel*) How to calculate the area and length of some object?

17 EE465: Introduction to Digital Image Processing 17 Resolution Enhancement based on Pixel Repetition abcdabcd a ab b c cd d zero-order first-order a (a+b)/2b (a+c)/2 (a+b+c+d)/4(b+d)/2 c (c+d)/2d

18 EE465: Introduction to Digital Image Processing 18 Bilinear Interpolation of Image X(m,n) row m row m+1 Col n Col n+1 X(m,n+1) X(m+1,n+1)X(m+1,n) Y a1-a b 1-b Q: what is the interpolated value at Y? Ans.: (1-a)(1-b)X(m,n)+(1-a)bX(m+1,n) +a(1-b)X(m,n+1)+abX(m+1,n+1)

19 EE465: Introduction to Digital Image Processing 19 Bicubic Interpolation* Which matlab function implements bicubic interpolation?

20 EE465: Introduction to Digital Image Processing 20 Edge-Sensitive Interpolation Step 1: interpolate the missing pixels along the diagonal black or white? Step 2: interpolate the other half missing pixels a b cd Since |a-c|=|b-d| x x has equal probability of being black or white a b c d Since |a-c|>|b-d| x=(b+d)/2=black x Please refer to esi1.m and esi2.m in interp.zip

21 EE465: Introduction to Digital Image Processing 21 Point Operations Overview Point operations are zero-memory operations where a given gray level x  [0,L] is mapped to another gray level y  [0,L] according to a transformation L L x y L=255: for grayscale images

22 EE465: Introduction to Digital Image Processing 22 Histogram Equalization Uniform Quantization Note: L 1 x L y 0 cumulative probability function Can you write your own matlab function to implement this?

23 EE465: Introduction to Digital Image Processing 23 MATLAB Implementation function y=hist_eq(x) [M,N]=size(x); for i=1:256 h(i)=sum(sum(x= =i-1)); End y=x;s=sum(h); for i=1:256 I=find(x= =i-1); y(I)=sum(h(1:i))/s*255; end Calculate the histogram of the input image Perform histogram equalization

24 EE465: Introduction to Digital Image Processing 24 2D Median Filtering 225 225 225 226 226 226 226 226 225 225 255 226 226 226 225 226 226 226 225 226 0 226 226 255 255 226 225 0 226 226 226 226 225 255 0 225 226 226 226 255 255 225 224 226 226 0 225 226 226 225 225 226 255 226 226 228 226 226 225 226 226 226 226 226 0 225 225 226 226 226 226 226 225 225 226 226 226 226 226 226 225 226 226 226 226 226 226 226 226 226 225 225 226 226 226 226 225 225 225 225 226 226 226 226 225 225 225 226 226 226 226 226 226 226 226 226 226 226 226 226 Y X ^ Sorted: [0, 0, 0, 225, 225, 225, 226, 226, 226]

25 EE465: Introduction to Digital Image Processing 25 Median Filtering with Noise Detection Noisy image Y x=medfilt2(y,[2*T+1,2*T+1]); Median filtering Noise detection C=(y==0)|(y==255); xx=c.*x+(1-c).*y; Obtain filtering results Why do we want to introduce noise detection?

26 EE465: Introduction to Digital Image Processing 26 Image Example clean noisy (p=0.2) w/o noise detection with noise detection

27 EE465: Introduction to Digital Image Processing 27 Image Deblurring: Inverse Filtering h(m,n) blurring filter h I (m,n) x(m,n) y(m,n) inverse filter To compensate the blurring, we require h combi (m,n) x(m,n) ^

28 EE465: Introduction to Digital Image Processing 28 Inverse Filtering (Con ’ t) h(m,n) + x(m,n)y(m,n) h I (m,n) inverse filter x(m,n) ^ Spatial: Frequency: amplified noise (what if H→0?)

29 EE465: Introduction to Digital Image Processing 29 Image Example Q: Why does the amplified noise look so bad? A: zeros in H(w 1,w 2 ) correspond to poles in H I (w 1,w 2 ) motion blurred image at BSNR of 40dB deblurred image after inverse filtering

30 EE465: Introduction to Digital Image Processing 30 Pseudo-inverse Filter Basic idea: To handle zeros in H(w 1,w 2 ), we treat them separately when performing the inverse filtering Why do we want to introduce this threshold parameter  ?

31 EE465: Introduction to Digital Image Processing 31 Image Example motion blurred image at BSNR of 40dB deblurred image after Pseudo-inverse filtering (  =0.1)

32 EE465: Introduction to Digital Image Processing Copyright Xin Li 32 Gradient Operators Motivation: detect changes change in the pixel valuelarge gradient Gradient operator image Thresholding edge map x(m,n) g(m,n) I(m,n) MATLAB function: > help edge

33 EE465: Introduction to Digital Image Processing Copyright Xin Li 33 Examples of Different Gradient Operators horizontal edgevertical edge Prewitt operator (th=48) original image

34 EE465: Introduction to Digital Image Processing Copyright Xin Li 34 Effect of Thresholding Parameters thresholdsmall large

35 $125000 100 row m row m+1 Col n Col n+1 200 100200 Y a1-a b 1-b a=0.25 b=0.25 What is Y? A)112.5 B)125 C)137.5 D)150 Bilinear Interpolation Numerical Example

36 $250000 225 225 225 226 226 226 226 226 225 225 255 226 226 226 225 226 226 226 225 226 0 226 226 255 255 226 225 0 226 226 226 226 225 255 0 225 226 226 226 255 255 225 224 226 226 0 225 226 226 225 225 226 255 226 226 228 226 226 225 226 226 226 226 226 What is the pixel value at red zero after median filter (window size 5- by5)? A)224 B)225 C)226 D)0

37 Part III Image-related tasks –A collection of “bonus problems” which can be solved by different tools –Mentally solve it vs. experimentally solve it –Designed like interview questions of major IT companies (except the default computing language)

38 Final-Jeopardy What are the angles of tripod in the image cameraman.tif?

39 Final-Jeopardy Process the baby.bmp image in CA5 so you can see baby clearly

40 Final-Jeopardy Turn Cameran image from grayscale to a greenish color image.


Download ppt "EE465 Midterm Review Mar. 23, 2010. MATLAB-based Midterm Exam Research-oriented learning Just like MATH, MATLAB is another tool (use it wisely) All Roads."

Similar presentations


Ads by Google