Skip to Content

Convolutional Neural Network CNN: What Does Applying This Filter to a Grayscale Image Do?

Learn how convolutional filters in CNNs detect horizontal edges in grayscale images. Understand the role of filter matrices in edge detection for CNN certification exams.

Table of Contents

Question

What do you think applying this filter to a grayscale image will do?

What do you think applying this filter to a grayscale image will do?

A. Detect image contrast
B. Detect 45 degree edges
C. Detect horizontal edges
D. Detect vertical edges

Answer

C. Detect horizontal edges

Explanation

This filter detects horizontal edges due to the following reasons:

Horizontal Gradient Emphasis:

  • The rows of the filter emphasize differences in pixel intensity along the vertical axis, which corresponds to detecting changes horizontally in the image.
  • Positive weights (e.g., 3) at the top and negative weights (e.g., −3) at the bottom amplify intensity differences between adjacent rows.

Sum of Rows:

  • Summing across rows yields zero ([0,0,0,0]), indicating that the filter captures changes in intensity between rows rather than within them. This is a hallmark of horizontal edge detection.

Directional Sensitivity:

  • The filter responds strongly to transitions where pixel values change significantly from one row to another (e.g., bright-to-dark or dark-to-bright transitions), highlighting horizontal edges.

Filter Behavior:

  • When applied to an image, this filter accentuates areas where there are abrupt changes in pixel intensity along horizontal lines, effectively isolating horizontal edges.

Supporting Analysis:

  • The sum of columns ([2,8,−8,−2]) indicates varying sensitivity across columns but does not align with vertical edge detection.
  • Filters designed for vertical edge detection typically have a structure where intensity changes are emphasized across columns rather than rows (e.g., Sobel or Prewitt filters for vertical edges).

By amplifying differences between adjacent rows, this filter is specialized for detecting horizontal edges in grayscale images.

Convolutional Neural Network CNN certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Convolutional Neural Network CNN exam and earn Convolutional Neural Network CNN certification.