

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
Material Type: Assignment; Professor: Jacobs; Class: Image Processing; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Written exercises (10 points each)
π
0
sin( )
π
0
sin 2 ( ) d
π sin( )cos( ) d 0
π
π
sin( )cos( ) d
2
a. Find the inner product between u = (1,2) and v = (1,3).
b. Use the inner product to find the angle between these two vectors.
c. Consider the vectors u=(4,-1,2) and w=(2,y,1). For what value of y are these vectors orthogonal?
d. Consider the vector v = (1,-1,3). Find two vectors, u and w, so that u ,v, and w are all orthogonal to each other.
Programming Assignment (20 points each)
The goal of this assignment is to give you some practice with Matlab, and to better familiarize you with correlation by implementing it. In each of these problems, the number of loops that you are allowed to use ( for or while ) is strictly limited. This is to get you to start thinking about the Matlab style of implementation, in which we try to
replace loops by performing a single operation on a whole vector or array at once. This is much more efficient in Matlab than iteration, and often leads to more elegant programs. In each problem I will indicate the number of loops that I think are necessary. You will lose two points for every excess loop that you use. Hint: for replication, you may want to create small matrices that replicate values, and use these to pad your initial matrices. Check what happens when you perform matlab calls such as: 7*ones(4,4) or ones(3,1)*[5,2,4].
Test your function by comparing the results of the following Matlab calls:
correlation_1d([1:4, 4:-1:1], [1/3 1/3 1/3]) imfilter([1:4, 4:-1:1], [1/3 1/3 1/3], 'replicate')
and
correlation_1d([1:4, 4:-1:1], .2ones(1,5)) imfilter([1:4, 4:-1:1], .2ones(1,5), 'replicate')
Turn in a file with your code, and a file showing the result of performing these operations.
Use the functions figure and plot to display this vector. Use print to save the image in a JPEG file, and turn this in, along with the code used to generate it.
b. Create an averaging filter that is 21 elements long, and correlate this with the sine wave you have generated. Using the functions above, and the additional command ‘ hold on’ , plot the result in the same figure as the original sine wave. Save this to a JPEG file, and turn this in along with code used to generate it. No loops are allowed.