A robot vision pipeline applies the same smoothing kernel to the same image row, yet a value near the image boundary changes after a software configuration change. The retained source pixels may be identical. What changed can be the invented values outside the image that the kernel is allowed to use.

A finite image does not contain every neighbor needed by a centered filter. Boundary padding supplies a mathematical extension. That extension becomes part of the calculation, so the padding rule belongs beside the kernel when describing a result.

OpenCV's Adding Borders to Your Images tutorial, version 4.12.0, distinguishes constant borders from borders that repeat the outer row or column. SciPy's convolve1d documentation, displayed as v1.18.0 when checked, additionally defines distinct reflection conventions. The examples below use original arrays and hand calculations, not reported software execution or camera tests.

Define the arithmetic first

Invent a one-dimensional row of six grayscale values:

10, 20, 40, 80, 100, 120.

Number their positions from zero through five. Use a centered five-tap symmetric kernel whose weights from left to right are 1, 2, 3, 2, 1, divided by nine. The weights sum to one.

For output at position i, calculate:

y_i = (x_(i−2) + 2x_(i−1) + 3x_i + 2x_(i+1) + x_(i+2))/9.

Because this kernel is symmetric, reversing its coefficients for convolution does not change the result. An asymmetric kernel would require a precise convolution-versus-correlation convention. Use exact real-valued arithmetic here and postpone any rounding or storage conversion.

At position two, all five required values are in the row. The result is (10 + 2×20 + 3×40 + 2×80 + 100)/9 = 430/9, approximately 47.7778. No boundary extension is consulted there.

At position zero, however, x_−2 and x_−1 are missing. Their assigned values change the calculation.

Zero padding assumes zero outside

Set every value beyond the retained row to zero. The first output sees the neighborhood:

0, 0, 10, 20, 40.

Its result is (0 + 0 + 30 + 40 + 40)/9 = 110/9, approximately 12.2222.

This is a valid defined filter result, but the two zero values were not observed by the camera. They were supplied by the boundary rule. Whether that extension represents the intended image-processing problem is a separate question.

The result is also not an average of only the three available source pixels with a newly normalized denominator. The declared kernel retains its original denominator of nine. Omitting missing terms and renormalizing would be another operation.

Replication repeats the endpoint

Now set both missing left neighbors to the first retained value, 10. The neighborhood becomes:

10, 10, 10, 20, 40.

The result is (10 + 20 + 30 + 40 + 40)/9 = 140/9, approximately 15.5556.

The retained data and the kernel did not change. Replication increased the result because it replaced the two zeros with endpoint copies. Those copies extend the observed boundary value; they do not constitute new independent image measurements.

Reflection needs an exact convention

Under a reflection that repeats the edge sample, x_−1 equals x_0 and x_−2 equals x_1. The first neighborhood is:

20, 10, 10, 20, 40.

The output is (20 + 20 + 30 + 40 + 40)/9 = 150/9, approximately 16.6667.

Under a reflection that does not repeat the edge sample, x_−1 equals x_1 and x_−2 equals x_2. The neighborhood is instead:

40, 20, 10, 20, 40.

The output becomes (40 + 40 + 30 + 40 + 40)/9 = 190/9, approximately 21.1111.

SciPy names the first convention reflect and the second mirror in the opened convolve1d reference. Other interfaces should be interpreted from their explicit extension definitions rather than assuming the same word identifies identical samples everywhere.

One boundary decision can cross a later threshold

Suppose a hypothetical next stage marks an output whenever it is strictly greater than 18. At the first position, only the non-edge-repeating reflection produces a marked output in this example. Zero, replication, and edge-repeating reflection do not.

That difference is caused entirely by the declared boundary convention. It is not a demonstrated change in defect-detection quality. The threshold is invented, and no physical ground truth has been assigned to the row.

The interior output at position two remains 47.7778 under all four extensions because its kernel support never leaves the original row. This locates the immediate cause: the extension affects calculations that request missing neighbors.

A constant field exposes an artificial boundary change

Take another hypothetical row, now with six values all equal to 50. The first zero-padded output is (0 + 0 + 150 + 100 + 50)/9, approximately 33.3333. An interior output is 50.

Replication and either reflection convention give 50 at the first position because every supplied neighbor is also 50. The normalized kernel preserves the constant value for those extensions.

The zero-padded drop is not evidence of a dark feature observed at the image edge. It follows from extending a constant retained field into a different, zero-valued field outside it. A later edge-sensitive operation can respond to that constructed transition.

A crop creates a new mathematical boundary

A region cut from a larger image may place its new boundary through an otherwise continuous scene. Filtering that crop with an extension rule is generally different from filtering the complete original image and then taking the same region.

The latter operation can use real neighboring pixels beyond the crop. The former substitutes whatever the padding rule defines. Tiled processing has the same distinction at tile boundaries unless the required surrounding data are retained consistently.

For a centered five-tap filter, the immediate support reaches two positions on either side. Repeated filtering or wider kernels can make additional outputs depend on earlier boundary assumptions. A padding record therefore describes part of the processing geometry, not merely how a preview is displayed.

The useful filter specification keeps the retained image region, kernel, alignment, extension convention, and numerical representation together. It then becomes possible to explain an edge-value change without attributing invented boundary pixels to the camera.

Sources checked October 23, 2026

OpenCV, Adding Borders to Your Images, version 4.12.0:

https://docs.opencv.org/4.12.0/dc/da3/tutorial_copyMakeBorder.html

SciPy, convolve1d, documentation displayed as v1.18.0:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.convolve1d.html

All arrays, weights, and threshold examples are hypothetical. No source example arrays, figures, or software outputs are reproduced.

Illustration note: The site-library concept image shows a robot above metal parts with a blue sensing pattern. It does not show a measured boundary response or a particular filtering implementation.