Psy 5036 Computational Vision Homework FAQ

If you have a question please e-mail:
Cindee Madison at cindee@cyclops.psych.umn.edu
OR
Dan Kersten at kersten@umn.edu

Assignment 1

General Suggestions:

1. Use the homework notebook given, just add text and cells to the original notebook you downloaded.
2. Make sure you read in packages before you use their functions.
3. Make sure you initialize all the cells in order.
4. You can use the function Clear[] to clear variables that you may have previously initialized.
5. If you run into many problems, quit the kernel and go through the notebook cell by cell, re-initializing each function and variable.
6. Check for spelling errors, or format errors (the help browser is a good resource for this).
7. If you get a strange error, but your function looks right, make sure you dont have an extra space in the function as this may cause problems.

Questions specific to the first homework

Question: When is the homework due?
Answer: Beginning of the class on Tuesday.

Question:How do I turn in my homework?
Answer: E-mail your finished mathematica notebook to cindee@cyclops.psych.umn.edu as an e-mail attachment. Or bring it into class on a disk Tuesday. Cindee will e-mail you to confirm she has recieved your e-mail.

Question: What is s.s ?
Answer: This is the dot product of the signal with itself. The dot product is also used by the cross-correlator which matched a trial image with a template.

Question: What is the s in s.s?
Answer: The s stands for your signal matrix.

Question: What do you mean by average gray?
Answer: We just want you to create a matrix (or vector, if you've already flattened the signal) where every entry is the same number. Since for gray valuse the range is 0-255, average gray would be 128, hence you would want a 16X16 matrix where all entries are 128.

The important point is that you want both the signal and the noise to be on the same scale. And when computing d' = Sqrt[s.s]/sigma, you use the same scale for s as for the template in the dot product of the cross-correlator. But when plotting pictures, the zero needs to be mapped to an average gray of 128. I admit the assignment is confusing on this, and needs clarification, so I hope the following does it. We'll give you two ways, A & B. In retrospect, I think A is clearer, but the assignment is written along the lines of B.

A. A simple way to do this is to keep the signal and noise scaled as defined, with the noise deviating about zero (and the grating also deviating about zero.) Zero then only needs to be mapped to an average gray when plotting. (When you plot it using ListDensity, the display gray levels range from 0 to 255, so zero should get mapped to 255/2 ~ 128.) The additive offset of 128 is only introduced for plotting. With this coordinate system, the observations also deviate about zero (i.e. again, we haven't introduced any additive offset):

v1 = Flatten[signal] + noise1

v2 = noise2

where noise1 and noise2 are distinct independent samples, each drawn from a distribution with zero mean, and a standard deviation of 48 (as given). Now calculate v1.Flatten[signal] and v2.Flatten[signal], and choose as correct the observation with the biggest dot product. (Don't compare sqrt(v1.signal)/sigma with sqrt(v2.signal)/sigma!).

B. Another way to handle the scaling is to map the zero for signal and noise to averagegray = 128, at the beginning e.g. when plotting it as: signal = signal +128. If you do this, then make sure that you store a separate copy of the signal template as, say s = Flatten[Table[Grating[x,y,1/16,1/16], {x,0,size-1},{y,0,size-1}]]. In other words, the template s should NOT have an additive offset. If you've done this, then the noise should also be put on the same scale:

v1 = signal + noise1

v2 = 128 + noise2 (i.e. as in the notes, averagegray = 128)

(Note that signal, v1 and v2 should all be deviating symmetrically, on average, about 128, only noise1 and noise2 deviate about zero). Now calculate v1.s and v2.s, and choose as correct the observation with the biggest dot product. Compare the d' you get from the proportion correct with the d' you get from Sqrt[s.s]/sigma.

Back to Psy5036 main page