import numpy as np from scipy.ndimage import gaussian_filter image = np.zeros((7, 7), dtype=np.float32) image[2:5, 2:5] = np.array( [ [0.2, 0.7, 0.2], [0.7, 1.0, 0.7], [0.2, 0.7, 0.2], ], dtype=np.float32, ) filtered = gaussian_filter(image, sigma=1.0, mode="reflect") print(f"input_shape: {image.shape}") print(f"output_shape: {filtered.shape}") print(f"output_dtype: {filtered.dtype}") print(f"center_before_after: {image[3, 3]:.3f} -> {filtered[3, 3]:.3f}") print(f"corner_after: {filtered[0, 0]:.4f}") print("filtered_center_row:", np.array2string(filtered[3], precision=3, suppress_small=True)) print("filtered_center_column:", np.array2string(filtered[:, 3], precision=3, suppress_small=True))