Sei sulla pagina 1di 3

IE 590 ADVANCED ROBOTICS AND MACHINE VISION

HOMEWORK #1: BASIC IMAGE PROCESSING AND REGION DESCRIPTION Due on Wednesday, Feb 15, 2012 (In lecture)

Theoretic Question

Implementation Question

Bonus Question

1. Image subtraction is used often in industrial applications for detecting missing components in product assembly. The approach is to store a reference image that corresponds to a correct assembly; this image is then subtracted from incoming images from the same product. Ideally, the differences would be zero if the new products are assembled correctly. Difference images for products with missing components would be nonzero in the area where they differ from the reference image. What conditions do you think that have to be met in practice for this method to work? 2. Show that 2-D convolutions with separable, symmetric kernels can be computed by (1) computing 1-D transforms along the individual rows (columns) of the input, followed by (2) computing 1-transforms along the columns (rows) of the result from step (1). 3. The implementation of linear spatial filters requires moving the center of a mask through an image, and at each location computing the sum of products of the kernel coefficients with the corresponding brightness value at that location. A mean filter will have all the coefficients 1 in the kernel. Formulate an efficient algorithm that consists of updating only the part of the computation that changes from one location to the next when scanning an image with an n x n filter. Show that your approach is more effective than the brute force method (calculating all the values every time that the kernel moves). 4. The images shown below are quite different, but their histograms are the same. Suppose that each image is blurred with a 3 x 3 averaging mask. Would the histograms of the blurred images still be equal? Explain. If your answer is no, sketch the two histograms. The small squares are 3 x 3. The size of the image is the same.

(a) (b) 5. Calculate and sketch a Gaussian kernel with =0.65 . Assume that the size of the kernel should be an odd n x n matrix with n = 6, at least. 6. Formulate Step 1 and the gradient magnitude image computation in Step 2 of the Canny algorithm using 1-D instead of 2-D convolutions. Is there any computational advantage for this change?

7. Two databases of images are provided to you, S1 and S2. There are ten images in each folder. Your task is to find automatically where the eyes, mouth and nose are in each image, using the first image in each database to obtain the template. The template is the minimum bounding box including the area to be found (e.g. eye, mouth or nose). To complete this task you need to implement the normalized cross-correlation formula ncc learned in class. Write a function that takes two arguments (one image and a template) and returns the coordinate of the match if the score of the match is high enough (you need to find the score threshold empirically), otherwise it returns null. The images are provided in the Blackboard website of the IE 590 class. You need to provide a sample script that tests your functions. 7.1 How well the eyes, mouth and nose are detected when the template and the images belong to the same database (S1, or S2)? Be specific, where it fails? Why? On which images it succeed? 7.2 What happened when the template is correlated with an image of a different dataset, e.g. template from S1 cross-correlated with images from S2, and the other way around? Where it fails? Why? On which images it succeed? 7.3 Do you have any idea how to improve the results? Example of images:
Source image Templates (zoomed in)

8. Given a scene of coins over a table (see the figure below), you are required to convert it to a BW image, so all the coins and keys in the image look complete and nice, and there are no additional spurious elements. The images provided are the background and the foreground. Use arithmetic operations, thresholds and binary processing (erode, dilate, open, close) for this task. 8.1 Show the histograms used for the conversion from grayscale to BW and explain the rationale for any decision. 8.2 Once you obtain a nice BW image including the keys and coins (without holes on the coins or additional blobs), implement the labeling algorithm in a Matlab function. The input of the function is the BW image, and the output is the number of objects in the image.

9. In the balloons image presented below find the necessary operations (conversion to grayscale, thresholding, logical operators AND, OR) to determine how many balloons of each color are presented in the image. Write a function in Matlab (and show its use) that has as input the balloons image, and the output is a name of the balloon color and the number of balloons for that color. To label the objects you can use the function that you wrote in 8.2.

Potrebbero piacerti anche