Question:medium

Applying a 3 × 3 mean filter centered on the grey shaded pixel in the input image, shown below, will result in an output value of __________ (Answer in integer).
Input image

Show Hint

Take the average of all 9 pixel values in the 3x3 window centred on the shaded pixel.
Updated On: Jul 20, 2026
Show Solution

Correct Answer: 3

Solution and Explanation

Step 1: Extract the filter window.
A 3x3 mean filter needs the 8 neighbours plus the centre pixel itself. Locating the shaded pixel (value 5) and taking one pixel on every side, the window is: $$ \text{Row 1: } 0,\ 1,\ 3 \qquad \text{Row 2: } 2,\ 5,\ 4 \qquad \text{Row 3: } 8,\ 3,\ 1 $$

Step 2: Sum row by row.
Row 1 sum: $0+1+3 = 4$. Row 2 sum: $2+5+4 = 11$. Row 3 sum: $8+3+1 = 12$.

Step 3: Add the row sums.
\[ 4 + 11 + 12 = 27 \] This matches summing the 9 values directly, confirming no term was missed.

Step 4: Apply the mean filter formula.
A mean filter's kernel is a $3\times3$ matrix of $\frac{1}{9}$ everywhere, so the output is the sum of the window divided by the number of cells, 9: \[ \text{Output} = \frac{27}{9} = 3 \]

Step 5: Confirm it is a valid integer answer.
Since 27 is exactly divisible by 9, the averaged output is the whole number 3, matching the answer in integer requirement. \[ \boxed{3} \]
Was this answer helpful?
0