← Image Processing for EveryoneToolsInVisionLearning Center
Neighborhood Filters · Lesson 30

Boundary Rules Change the Result

The filter changes the pixels at the left edge of a photograph.

Watch the lesson

Boundary Rules Change the Result explained visually

1:24

The filter changes the pixels at the left edge of a photograph. English captions are optional and start off. The complete transcript follows the written lesson.

Lesson overview

What you will learn

The filter changes the pixels at the left edge of a photograph.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

A smoothing filter makes the left border of our metal-part image unexpectedly dark. The calculation in the center looked fine. What changed at the border? The kernel reached beyond the saved image and asked for pixel values that don't exist. Software has to choose some substitute for those missing neighbors.

02

The useful idea

One option fills the outside with zeros. Another repeats the nearest edge value. A third reflects pixels as if the image continued in a mirror. These choices can give different answers with exactly the same kernel. Zero padding may pull a bright edge toward black. Reflection can avoid that dark strip, but can also invent a mirrored pattern near the border.

03

Work through the example

Run the same smoothing filter on one image with zero padding and another with reflection. Put the borders side by side and compare them with the untouched input. Then check whether the inspected part reaches the edge of the frame. If it does, this choice may affect the actual measurement, not merely the presentation.

04

Limits and next step

Record the boundary rule with the kernel and its parameters. It is part of the algorithm. Next, we'll use Gaussian smoothing and decide how much detail we can afford to blur.

Worked example

Compare zero padding with reflecting the edge for the same smoothing kernel.

Knowledge check

Quick check: test your understanding

Try it yourself: In the situation described above, explain the method and one reason its output might be misleading.

Check the reasoning

Padding or boundary rules define the missing neighbors outside the image. Different choices can create artificial dark borders or mirror patterns.

What is the main idea behind boundary rules change the result?

Padding or boundary rules define the missing neighbors outside the image.

How is it used in the example?

Compare zero padding with reflecting the edge for the same smoothing kernel.

What limitation should be checked?

Different choices can create artificial dark borders or mirror patterns.

Further reading

Digital Image Processing, 4th edition — Rafael C. Gonzalez and Richard E. Woods.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 30 transcript196 words · Video transcript · Matches the published narration and captionsOpen transcript

A smoothing filter makes the left border of our metal-part image unexpectedly dark. The calculation in the center looked fine. What changed at the border? The kernel reached beyond the saved image and asked for pixel values that don't exist. Software has to choose some substitute for those missing neighbors.

One option fills the outside with zeros. Another repeats the nearest edge value. A third reflects pixels as if the image continued in a mirror. These choices can give different answers with exactly the same kernel. Zero padding may pull a bright edge toward black. Reflection can avoid that dark strip, but can also invent a mirrored pattern near the border.

Run the same smoothing filter on one image with zero padding and another with reflection. Put the borders side by side and compare them with the untouched input. Then check whether the inspected part reaches the edge of the frame. If it does, this choice may affect the actual measurement, not merely the presentation.

Record the boundary rule with the kernel and its parameters. It is part of the algorithm. Next, we'll use Gaussian smoothing and decide how much detail we can afford to blur.