EN161 Image Understanding
Lab 1: Playing with Images

Due: Wednesday, September 21, 2005

  
General Information
  • The laboratory sessions will build on the material covered in the class, and aim to solidify your understanding of concepts through hands-on experimentation. You will see and believe for yourself that image processing is fun and one can produce useful results. The sessions will involve solving the assigned problems using MATLAB. You will hand in a report on the assignment worked out during the session and afterwards. The reports will include the results- e.g., images, observations, and answers to specific questions- obtained, and the MATLAB programs written for that purpose. 
 

NOTE: Problems should be done in MATLAB. You should submit:
(1)
A brief report for the questions listed below including the output images, function names, etc.
(2)
The source code of the functions you implemented

Important:
Make sure your code works when you send it to me. I should be able to reproduce your results.

Zip or tar your document with your source code (m-files) into a file called [Lastname_Lab1.zip/tar] and email it to ieden@lems.brown.edu with the subject "EN161 Lab1".

 

Question 1: For this question, use the "quart.jpg" image. You will write a MATLAB function named "image_crop.m".

This function will:
a) take the image path (string) as an input,
b) read the image in the given path (hint: use "imread" function)
c) display it to the user (hint: use "imshow" function)
d) the user will select two points on the image (hint: use "ginput" function to select points. you will assume that the first point is the top left corner and the second point is the bottom right corner)
e) crop the rectangular image region defined by the two points in "d"
f) save the new rectangular image to the disk (hint: use "imwrite" function)

 

Question 2: For this question, use the "dolphins.jpg" image. You will write a MATLAB function named "image_patch.m".

This function will:
a) crop the 90x45 rectangular region defined by P1(132,136) and P2(222,181)
b) rotate the new rectangular image by 90 degrees (for this you have to implement your own rotation function, do not use built in "imrotate" function)
c) put the rotated image to the rectangular region defined by P3(181,21) and P4(225,110)
d) display the output image

 

Question 3: For this question, use the "camman.jpg" image. You will write a MATLAB function named "plot_intensity.m".

This function will:
a)
Plot the intensity values along the horizontal strip (row) y = 20 (for part a and b you can use the built in MATLAB "plot" function )
b) Plot the intensity values along the horizontal strip (row) y = 75
c) Plot the two strips on the same graph (you will have to use the command "hold", try "help hold") and explain how and why the plots differ?
d) From the graphs can you roughly determine object boundaries along the strip y= 75? Explain.

 

Question 4: For this question, use the "bquart.jpg" image (Blurred version of quart.jpg). You will write a MATLAB function named "image_histogram.m".

This function will:
a)
Obtain the histogram of intensity levels using different number of bins (e.g. 64 and 256) (Hint: (1) use MATLAB's built in histogram command "hist", (2) convert the image content into a 1 dimensional array before using "hist")
b)
Print the histogram with 64 bins and 256 bins. What do the two peaks correspond to in terms of the image content?
c) Using your observation from part b, try to segment the image into object/background (coins/background).
d) Display the segmentation results using two gray levels (such as black and white). Print the resulting image. It should more or less look like the "bquart.jpg" image in Question 5.

 

Question 5: For this question, use the "bquart.jpg" image (the image above). You will write a MATLAB function named "image_segmentation.m".

Given a point on the top of the image P(215,0), design an algorithm to find a line passing through P such that there will be two coins on each side of the line. Which representation of a line is good for this kind of an application? (Hint: you should check which side of a line an arbitrary point is on)