4
Practice Midterm, EE 264 Spring 2018 1) Below left you see a Fourier series of frequencies and below on the right an empty frequency plot. Please, fill in the empty frequency plot with the Fourier series! Note: One frequency is twice as high as the other one. They both have the same amplitude. 2) What would be the result if you were to convolve the image below and the kernel below? Answer: The image will be shifted one pixel to the left. 3) What operation could you use to produce the image (c) from the images (a) and (b)?

ee264-spring18-01.courses.soe.ucsc.edu · Web viewNote: The convolution is a linear operation. The convolution of a Gaussian with itself is a wider Gaussian. Thus, the convolution

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Practice Midterm, EE 264 Spring 2018

1) Below left you see a Fourier series of frequencies and below on the right an empty frequency plot. Please, fill in the empty frequency plot with the Fourier series!

Note: One frequency is twice as high as the other one. They both have the same amplitude.

2) What would be the result if you were to convolve the image below and the kernel below?

Answer: The image will be shifted one pixel to the left.

3) What operation could you use to produce the image (c) from the images (a) and (b)?

(a) (b) (c)

Answer: a – b = c

Note: You need to subtract b from a. If you instead add a and b you make the shading gradient worse. If you instead to perform some type of multiplication or division with the images, you could manage to remove the background shading gradient in the light squares, but you would corrupt the black squares, of the checkerboard pattern.

4) An image histogram lets us visualize what gray level values are present in an image, and how many pixels there are in the image with a specific one of these gray levels. What does the histogram of the synthetic image of squares (below on the left) look like? Please, draw out the histogram in the empty histogram plot!

(Hint: As you can see, there are four gray levels present in this image. You can assume that this is an 8 bit image, meaning gray values go from 0 black to 255 white)

5) When we take a photograph with a camera (or image with a microscope) the image is effectively a convolution of every point in the object with the optical transfer function of the camera. This transfer function is airy function, which is the Fourier transform of the circular aperture of the camera. The effect is a blurring the finest details in the object. Below you see an example of an image convolution that works in the same way. The image on the left is convolved with the Gaussian kernel in the middle which produces the image on the right.

Now, what would happen if we convolved the image with the same Gaussian again?

· Answer: The image would become even more blurred

Note: The convolution is a linear operation. The convolution of a Gaussian with itself is a wider Gaussian. Thus, the convolution of an image followed by another convolution of the resulting image with the same Gaussian, will produce more blur. Identically, the convolution of the original image with the Gaussian convolved by itself will produce this more blurred image.

4

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept. 7

Histogram Processing:

Graylevel

9

15

7

5 Histogram:

• Distribution of gray-levels can be judged by measuring a Histogram

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept. 8

For B-bit image,

• Initialize 2B counters with 0 • Loop over all pixels x,y • When encountering gray level f(x,y)=i, increment the counter number i

• With proper normalization, the histogram can be interpreted as an estimate of the probability density function (pdf) of the underlying random variable (the graylevel) •You can also use fewer, larger bins to trade off amplitude

Histogram Processing:

4

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

7

Histog ram Proce ssin g:

Graylevel

9

15

7

5

Histogram:

•Distributi on of gray -levels can be judged

by meas uring a Histogram

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

8

For B-bit image,

• Initialize 2

B

counters with 0

• Loop ov er all pixels x,y

• When encountering gra y level f(x,y)=i, increment

the counter number i

• With proper normalizat ion, the histogram can be

interpret ed as an estimate of the probability densi ty

function (pdf) of the underly ing random variable (the

graylevel)

•You can also use fewer, larger bins to trade off

amplitude

His togram Proc essing:

14

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Choosing kernel width

• Rule of thumb: set filter half-width to about 3 σ

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Example: Smoothing with a Gaussian

14

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Choos ing kernel width

•Rule of thum b: set filter half -width to about

3 σ

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Examp le: Smoo thin g with a Gau ssia n

14

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Choosing kernel width

• Rule of thumb: set filter half-width to about 3 σ

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Example: Smoothing with a Gaussian

14

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Choos ing kernel width

•Rule of thum b: set filter half -width to about

3 σ

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Examp le: Smoo thin g with a Gau ssia n

14

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Choosing kernel width

• Rule of thumb: set filter half-width to about 3 σ

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Example: Smoothing with a Gaussian

14

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Choos ing kernel width

•Rule of thum b: set filter half -width to about

3 σ

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Examp le: Smoo thin g with a Gau ssia n

9

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Practice with linear filters

0 0 0

1 0 0

0 0 0

Original

?

Source: D. Lowe

EE 264: Image Processing and Reconstruction Peyman Milanfar UCSC EE Dept.

Practice with linear filters

0 0 0

1 0 0

0 0 0

Original Shifted left By 1 pixel

Source: D. Lowe

9

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Prac tice with linear filters

0 0 0

1 0 0

0 0 0

Original

?

Source: D. Lowe

EE 264: Image Processing and Reconstruction

Peyman Milanfar

UCSC EE Dept.

Prac tice with linear filters

0 0 0

1 0 0

0 0 0

Original

Shifted left

By 1 pixel

Source: D. Lowe