Build a normalized separable Gaussian kernel and apply it to a grayscale image with the specified padding behavior.