**1. Recall the four sequential stages of the Canny edge detector:**
1. **Gaussian smoothing:** Convolve the image with a Gaussian filter to suppress high-frequency noise before taking derivatives.
2. **Gradient computation:** Compute intensity gradient magnitude and orientation (e.g., using Sobel operators).
3. **Non-maximum suppression (NMS):** Thin wide gradient ridges into 1-pixel-wide candidate edges by keeping only local maxima along the gradient direction.
4. **Hysteresis thresholding:** Use high and low thresholds (\( T_{\text{high}}, T_{\text{low}} \)) to accept strong edges and connect weak edges that touch strong edges.
**Answer: B — Gaussian smoothing → gradient computation → non-maximum suppression → hysteresis thresholding.**
A: **Incorrect:** Non-maximum suppression cannot be performed before computing the image gradients.
B: **Correct:** Follows the exact Canny pipeline: noise reduction (Gaussian), gradient calculation, edge thinning (NMS), and edge tracking (hysteresis).
C: **Incorrect:** Smoothing must precede gradient computation to prevent noise amplification, and NMS precedes hysteresis thresholding.
D: **Incorrect:** Gradients must be computed right after smoothing before NMS or thresholding can occur.
Nesterov momentum looks ahead and often converges faster than classical
momentum.
6406536373697.
large fixed learning rate always speeds convergence.
6406536373698.
Adam uses only a first-moment estimate of gradients.
6406536373699.
None of these.
Published solution
**1. Evaluate each statement about optimization algorithms:**
- **Option A:** Nesterov Accelerated Gradient (NAG) evaluates the gradient at the 'look-ahead' position \( \theta_t - \gamma v_{t-1} \) rather than the current position \( \theta_t \). This anticipatory correction prevents overshooting and typically yields faster convergence than classical momentum. True.
- **Option B:** An overly large fixed learning rate causes oscillations or divergence rather than faster convergence. False.
- **Option C:** Adam (Adaptive Moment Estimation) maintains **both** a first-moment estimate (exponentially decaying average of gradients) and a second-moment estimate (exponentially decaying average of squared gradients). False.
- **Option D:** False since Option A is true.
**Answer: A — Nesterov momentum looks ahead and often converges faster than classical momentum.**
A: **Correct:** Nesterov momentum computes the gradient at the look-ahead parameter position, reducing oscillations and speeding up convergence.
B: **Incorrect:** A large fixed learning rate can overshoot minima and cause the loss to diverge.
C: **Incorrect:** Adam tracks both first-moment (mean) and second-moment (uncentered variance) estimates of the gradients.
D: **Incorrect:** Statement A is true.
**1. Recall the four stages of the SIFT (Scale-Invariant Feature Transform) pipeline:**
1. **Scale-space Extrema Detection:** Search over Difference-of-Gaussian (DoG) scale space to identify candidate interest points across scales and spatial locations.
2. **Keypoint Localization:** Refine candidate locations to sub-pixel accuracy and reject low-contrast points and poorly localized edge responses.
3. **Orientation Assignment:** Assign one or more dominant gradient orientations to each keypoint to achieve rotation invariance.
4. **Keypoint Descriptor:** Compute a 128-dimensional local gradient histogram descriptor relative to the keypoint's scale and orientation.
**Answer: B — Extrema Detection → Localization → Orientation → Descriptor.**
A: **Incorrect:** Reverses the entire SIFT pipeline; you cannot assign orientation before detecting keypoints.
B: **Correct:** Matches Lowe's four-stage SIFT pipeline in exact order.
C: **Incorrect:** The descriptor is computed last, after keypoint localization and orientation assignment.
D: **Incorrect:** Option B gives the exact order.
**1. Define a separable 2D kernel:**
A \( 3 \times 3 \) matrix \( K \) is separable if and only if it has rank 1, meaning it can be written as the outer product of a \( 3 \times 1 \) column vector \( u \) and a \( 1 \times 3 \) row vector \( v^T \) (\( K = u v^T \), so every row is a scalar multiple of the first row).
**2. Check each option:**
- **Option A:** \( \begin{bmatrix} 1 & 0 & -1 \\ 2 & 0 & -2 \\ 1 & -50 & -2 \end{bmatrix} \). Row 3 is not a multiple of Row 1. Not separable.
- **Option B:** \( \begin{bmatrix} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \end{bmatrix} \) (4-neighbor Laplacian). Row 2 is not a multiple of Row 1 (rank 2). Not separable.
- **Option C:** \( \frac{1}{16} \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 1 & 2 & 1 \end{bmatrix} = \frac{1}{4}\begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix} \cdot \frac{1}{4}\begin{bmatrix} 1 & 2 & 1 \end{bmatrix} \) (the \( 3 \times 3 \) Gaussian smoothing kernel). Every row is a multiple of \( [1, 2, 1] \) (rank 1), so it is **separable**.
- **Option D:** \( \begin{bmatrix} 0 & 1 & 0 \\ 1 & -4 & 1 \\ 0 & 1 & 0 \end{bmatrix} \) (Laplacian). Rank 2, not separable.
**Answer: C.**
A: **Incorrect:** The third row \( [1, -50, -2] \) is not proportional to \( [1, 0, -1] \), so the matrix rank is greater than 1.
B: **Incorrect:** The 2D Laplacian kernel has rank 2 and cannot be factored as a single outer product \( u v^T \).
C: **Correct:** The \( 3 \times 3 \) Gaussian kernel \( \frac{1}{16}\begin{bmatrix}1&2&1\\2&4&2\\1&2&1\end{bmatrix} \) factors into \( \frac{1}{4}[1,2,1]^T \times \frac{1}{4}[1,2,1] \).
D: **Incorrect:** The negative Laplacian kernel also has rank 2 and is not separable.
**1. Understand the Integral Image (Summed-Area Table) formula:**
Given the \( 3 \times 3 \) integral image:
\[
II = \begin{bmatrix} 4 & 9 & 12 \\ 10 & 20 & 30 \\ 15 & 33 & 50 \end{bmatrix}
\]
The sum of original pixel intensities over the sub-rectangle spanning rows \( 2..3 \) and columns \( 2..3 \) (1-based indexing) is given by inclusion-exclusion:
\[
S = II(3, 3) - II(1, 3) - II(3, 1) + II(1, 1)
\]
**2. Substitute the entries from \( II \):**
\[
S = 50 - 12 - 15 + 4 = 27
\]
**Answer: 27.**
**1. Trace the NumPy array assignment:**
- `arr = np.array([[9, 8], [7, 6]])` creates a \( 2 \times 2 \) array.
- `alias = arr` does **not** copy the array; `alias` and `arr` point to the exact same underlying array object in memory.
- `alias[1, 1] = 0` modifies the element at row 1, column 1 in-place to `0`.
**2. Conclude:**
Because `arr` and `alias` reference the same array, `arr[1, 1]` is now `0`.
**Answer: 0.**
The sum of the degrees of freedom for translation and affine transformations in 3D is __
Published solution
**1. Analyze the degrees of freedom (DoF) in 3D:**
- A 3D translation vector \( \mathbf{t} \in \mathbb{R}^3 \) has \( 3 \) degrees of freedom.
- A 3D linear transformation matrix \( A \in \mathbb{R}^{3 \times 3} \) has \( 9 \) degrees of freedom.
- A 3D affine transformation \( \mathbf{x}' = A\mathbf{x} + \mathbf{t} \) combines the 9 linear parameters and the 3 translation parameters, giving a total of:
\[
9 + 3 = 12 \text{ degrees of freedom}
\]
**2. Note on wording:**
The official key is `12` (representing the combined degrees of freedom of the translation and linear/affine components that make up a 3D affine transformation; if 3D translation (3 DoF) and a full 3D affine transformation (12 DoF) are summed separately, the literal sum is \( 3 + 12 = 15 \)).
**Answer: 12.**
**1. Identify the \( 3 \times 3 \) window corresponding to output position \( (3, 3) \):**
When applying a \( 3 \times 3 \) filter with stride 1 and no padding to a \( 5 \times 5 \) image, the output is a \( 3 \times 3 \) matrix. Position \( (3, 3) \) (1-based, bottom-right entry of the \( 3 \times 3 \) output) corresponds to the bottom-right \( 3 \times 3 \) patch of the \( 5 \times 5 \) input image (rows 3 to 5, columns 3 to 5):
\[
\begin{bmatrix}
19 & 26 & 28 \\
22 & 17 & 18 \\
24 & 20 & 27
\end{bmatrix}
\]
**2. Sort the 9 values in ascending order to find the median:**
\[
17,\ 18,\ 19,\ 20,\ \mathbf{22},\ 24,\ 26,\ 27,\ 28
\]
The 5th (middle) element is \( 22 \).
**Answer: 22.**
**1. Recall the 8-neighbor discrete Laplacian kernel:**
When including all 8 immediate neighbors (horizontal, vertical, and diagonal) with weight \( -1 \) around the center pixel (or positive center with negative surround so the sum of all 9 weights equals zero), the \( 3 \times 3 \) discrete Laplacian mask is:
\[
L_8 = \begin{bmatrix}
-1 & -1 & -1 \\
-1 & 8 & -1 \\
-1 & -1 & -1
\end{bmatrix}
\]
**2. Conclude:**
To balance the 8 surrounding \( -1 \) weights so the filter response on a constant region is zero, the middle (center) element is \( 8 \).
**Answer: 8.**