0 Project 1 – Input/Output Image (Due: 10/11) 1.1. (i) Design a program to input and output a...

14
1 Project 1 – Input/Output Image (Due: 10/11) 1.1. (i) Design a program to input and output a color image. You may download the program “bmp_io.rar” from http://www.cs.ucsd.edu/classes/sp03/cse19 0 -b/hw1 / . (ii) Transform the output color image C(R,G,B) into a grayscale image I by I = (R+G+B)/3.

Transcript of 0 Project 1 – Input/Output Image (Due: 10/11) 1.1. (i) Design a program to input and output a...

1

Project 1 – Input/Output Image (Due: 10/11)

1.1. (i) Design a program to input and output a color image. You may download the program “bmp_io.rar” from http://www.cs.ucsd.edu/classes/sp03/cse190-b/hw1/ . (ii) Transform the output color image C(R,G,B) into a grayscale image I by I = (R+G+B)/3.

Color image Grayscale image

3

2.1. Giving the boundary and corners of an object (you can create by hand), construct chamfer distance arrays for (i) the boundary and (ii) the corners, respectively. It is not necessary that the boundary and corners you created are one-pixel wide. Show the distance arrays, separately, in the image form. Note that before displaying the arrays, its values have to be scaled between 0-255.

Project 2 – Chamferring (Due: 10/24)

Boundary Corners

Boundary image Boundary (chafer array)

Corner image Corners (chafer array)

5

Project 3 – Noise Generators (Due: 11/14)

2.2. (i) Create an image g(x,y) whose pixels all have the same gray value of 100. Show image g(x,y). (ii) Generate Gaussian noise with using a) algorithm 2.3, n(x,y), and b) the method addressed in the class, n’(x,y). Show the noisy images f(x,y) and f’(x,y), where f(x,y) = g(x,y) + n(x,y), f’(x,y) = g(x,y) + n’(x,y). (iii) Display the histograms h(i) and h’(i) of the noisy images f(x,y) and f’(x,y). (iv) Generate salt-and-pepper (impulse) noise. (v) Comment on your results.

20, 25

Input image with gray values of 100

Gaussian noise (Method 1) Histogram

Gaussian noise (Method 2) Histogram

Gaussian Noise

0.37 for 15

( ) 0.63 for 12

0 otherwise

x

p x x

Salt and Pepper Noise

8

Project 4 – Bayer Images (Due: 11/28)

2.3. (i) Choose a color image C. (ii) Create a Bayer image B from image C according to the following Bayer pattern.

(iii) Generate a color image C’ from the Bayer image B using any interpolation method. (iv) Compare images C and C’.

p.s. It would be very encouraged if you could try more than one interpolation method.

Color image Bayer image

Bilinear interpolation Constant hue-based interpolation

10

Project 5 – LBC and Ratio images (Due: 12/12) 3.1. (i) Choose a gray level image G. (ii) Generate the 4- and 8-neighbor LBC images of G. (iii) Display the LBC images

Note that before displaying the 4-neighbor LBC image, its codes have to be scaled between 0-255•

3.2. (i) Choose a gray level image G. (ii) Compute its ratio image R. (iii) Display image R.

Note that before displaying image R, its pixel values have to be scaled between 0-255•

Grayscale image 4-neighbor LBC image

8-neighbor LBC image Ratio image

12

Project 6 –Histogram Equalization and Specification (Due: 1/13)

(b) Develop the histogram specification (HS) procedure•

characterized by the following specification 2( 127)

6251 1 2

( ) 0 1255 25525 2

zk

z k kp z e , z , , , ,

(a) Develop the histogram equalization (HE) procedure.

The HS procedure is summarized in the next page.(c) Perform your HE and HS procedures on 2-3

experimental images and discuss the results.

Grayscale image Histogram equalization

Histogram specification

5-14

The HS Procedure:

Given: input image (I), specification ( ) 1. Compute the histogram of I

2. Compute from

3. Compute from

4. Compute

5. Transform I into O by

( )z k

p z( )

r jp r

zp

1 1( ( )) ( )k k k

z G T r G s 1( ( ))

k kz G T r

0 0( ) ( )

k k j

k k r jj j

ns T r p r ,

n

0( ) ( )

k

k z i ki

G z p z s ,

rp