A machine vision job smooths a wide image in two tiles. The pixel values near the center seam differ from those produced when filtering the original frame. Each tile treated the seam as its own image boundary and reflected pixels from its side. To reproduce the full-frame calculation, include real neighboring samples from the adjacent tile, then discard those extra columns from the output.

Size the overlap from the kernel

SciPy's Gaussian filter accepts an explicit radius. With radius 2, the kernel has five samples along each filtered axis. A retained pixel may use input as far as two columns or rows away. When dividing only along columns, give each tile two extra columns at its internal edge. Keep the original border treatment at the outside edges of the frame.

import numpy as np

from scipy.ndimage import gaussian_filter

frame = np.zeros((6, 8), dtype=np.float64)

frame[:, 4:] = 100

split, radius = 4, 2

settings = dict(sigma=1.0, radius=radius, mode="reflect")

reference = gaussian_filter(frame, **settings)

left = gaussian_filter(frame[:, :split + radius], **settings)

right = gaussian_filter(frame[:, split - radius:], **settings)

stitched = np.column_stack((left[:, :split], right[:, radius:]))

no_overlap = np.column_stack((

gaussian_filter(frame[:, :split], **settings),

gaussian_filter(frame[:, split:], **settings),

))

assert np.allclose(stitched, reference)

assert np.allclose(no_overlap[3, 3:5], [0, 100])

Here the input switches from 0 to 100 between columns 3 and 4. SciPy 1.18.1 reports approximately 29.869 and 70.131 at those columns in the full-frame result. Filtering each unextended tile returns 0 and 100 there. Keeping two real columns across the seam, filtering, then trimming those columns from each output gives the same values as the full-frame reference throughout the test image.

Use a seam test when changing the kernel

Move a known intensity transition across the planned split and compare the full-frame result with the stitched result. Record the radius, boundary mode, data type, and output crop. Use floating-point arrays for a numerical comparison if the production code converts to integers later. An explicit radius keeps the overlap tied to the actual support when the standard deviation changes. If the radius is implicit, derive the support from the filter settings and verify it against the implementation in use.

If tiles split along both axes, keep enough neighboring rows and columns, including corner pixels. A sequence of local filters can require a wider input region than any one stage if the whole sequence runs on each tile before the crop. Repeat the seam test for the complete processing chain before using the stitched image for defect measurements.

Sources

SciPy gaussian_filter reference for per-axis radius and boundary modes

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

SciPy gaussian_filter1d reference for finite kernel support along one axis

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