Image Processing¶
fdtdx.core.gaussian_blur.gaussian_blur_3d(image, sigma, kernel_size, *, padding='SAME', channel_axis=-1)
¶
Applies 3D Gaussian blur by convolving the image with separable Gaussian kernels.
This function implements an efficient 3D Gaussian blur by decomposing the 3D Gaussian kernel into three 1D kernels and applying them sequentially along each axis. This is mathematically equivalent to a full 3D convolution but much more computationally efficient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
Array
|
The input image as a float tensor with values in [0,1]. Should have 4 or 5 dimensions: [batch?, depth, height, width, channels] or [batch?, channels, depth, height, width]. The batch dimension is optional. |
required |
sigma
|
float
|
Standard deviation (in pixels) of the Gaussian kernel. Controls the amount of blurring - larger values produce more blurring. |
required |
kernel_size
|
float
|
Size (in pixels) of the cubic Gaussian kernel. Will be rounded up to the nearest odd integer to ensure the kernel is symmetric. Should be at least 2 * ceil(3 * sigma) + 1 to avoid truncating the Gaussian significantly. |
required |
padding
|
str
|
Either "SAME" or "VALID". With "SAME" padding the output has the same spatial dimensions as the input. With "VALID" padding the output is smaller due to no padding being added. |
'SAME'
|
channel_axis
|
int
|
The axis containing the channels in the input tensor. Use -1 for channels-last format (default) or 1 for channels-first format. |
-1
|
Returns:
Type | Description |
---|---|
Array
|
jax.Array: The blurred image tensor with the same shape and data format as the input. With "SAME" padding the spatial dimensions match the input. With "VALID" padding they are reduced by (kernel_size - 1) in each dimension. |