

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
During the studies,their is a program called Introduction to computer vision offered in our university, this course is very helpful. The main points disucss in these lecture slides are:Binarization, Morphological Image Processing, Connected Components, Edge Detection, Matlab Function, Detection Algorithm, Intensity Level, Morphological Algorithms, Erosion Algorithm, Dilation
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CSE152 – Intro to Computer Vision – Assignment # Instructor: Prof. David Kriegman. http://cseweb.ucsd.edu/classes/sp12/cse152-a Due Date: Thu. May 11, 2012.
Write a Matlab function to implement the ’peakiness’ detection algorithm described in class. This algorithm should automatically determine an intensity level to threshold an image to segment out the foreground from the background. The output of your function should be a binary image that is 0 for all background pixels and 1 for all foreground pixels. Apply this function to the image coins.png and turn in the output image in your report. [9 points] Notes:
Morphology refers to application of set operations such as union and intersection on an image. Morphological algorithms take as input an image and a structuring element, which encodes the shape characteristics based on which the input image must be processed. Usually, the structuring element is a (2k + 1) × (2k + 1) array, where k is a small number (say, between 1 and 5). In general, a morphological operation is performed by making a copy of the input image. The structuring element, S, is compared to a (2k + 1) × (2k + 1) window neighborhood, W , of each pixel of the input image. If W exactly matches S, then the corresponding pixel of the copy image is set to a particular value (0 or 1, depending on particular operation), else that pixel in the copy is left unchanged.
(a) Erosion: The desired effect in erosion is that any foreground pixel which has a background pixel as a neighbor is set to background. Consider the 3 × 3 structuring element:
The 3 × 3 neighborhood of each pixel in the input image is compared to this structuring element S 1 and the corresponding pixel in the copy image is set to background if they do not match, else it is left unchanged. Thus, it causes the boundary of the foreground to shrink. Write Matlab
code to perform erosion using the element S 1 on the image hole.png. Remember to convert the input to a binary image first. Display your output after the image has been eroded by 1, 4 and 10 passes of the erosion algorithm. [8 points]
(b) Now repeat question (a) with a structuring element S′ 1 of the same form as S 1 , but of size 7 × 7. Also, give a qualitative description of the effect of increasing the size of the structuring element. [4 points]
(c) Dilation: The dual problem to erosion is called dilation. Here the aim is to use a morphological operation to expand the boundary of the foreground region of an image. One way to do this is the following:
for each background pixel p Let N = neighborhood of p if N contains only background pixels leave p unchanged else set p to foreground end end
Describe the process and structuring element, S 2 , you would use to perform dilation on an input image. Write Matlab code that takes as input the image hole.png, the structuring element you have devised and desired number of passes. The output should be the dilated image after the specied number of dilation passes. Display the dilated image after 1, 4 and 10 passes.[6 points]
(a) Write Matlab code to implement the connected component labeling algorithm discussed in class, assuming 8-connectedness. Your function should take as input a binary image (computed using your algorithm from question 1) and output a 2D matrix of the same size where each connected region is marked with a distinct positive number (e.g. 1, 2, 3). On the image ucsd.jpg, display an image of detected connected components where connected region is mapped to a distinct color (using the function imagesc in Matlab). [9 points]
(b) How many components do you think are in the image coins.png? What does your connected component algorithm give as output for this image? Can you use one of the morphological operations in Question 1 to help separate out the individual coins in this image? Write Matlab code combining your morphological operator and connected components algorithm, and use it to count the number of coins. Include any relevant figures for this separation in your report. [ 6 points] Notes: