Blur#

class deeptrack.optical.math.Blur(_input: Any | None = None, **kwargs: Any)#

Bases: Feature

Backend-dispatched abstract base class for blurring operations.

This class defines a unified interface for applying blur filters across multiple computational backends (NumPy and PyTorch). Subclasses are responsible for implementing the backend-specific logic via _get_numpy and _get_torch.

Subclasses must implement at least one of:

_get_numpy(image, **kwargs) _get_torch(image, **kwargs)

Methods#

get(image, **kwargs) -> np.ndarray | torch.Tensor

Applies the blur using the selected backend.

Methods Summary

get(image, **kwargs)

Apply the blur filter to the input image using the selected backend.

Methods Documentation

get(image: np.ndarray | torch.Tensor | ScatteredVolume | ScatteredField, **kwargs: Any) np.ndarray | torch.Tensor#

Apply the blur filter to the input image using the selected backend.

This method applies the blur filter to the input image using the selected backend. It dispatches to the appropriate backend-specific implementation based on the type of the input image and the configured backend. It also handles unwrapping of scattered objects if necessary.

Parameters#

image: np.ndarray or torch.Tensor or ScatteredVolume or ScatteredField

The input image to blur. Must be compatible with the selected backend. If a scattered object is provided, the blur will be applied to its underlying array.

**kwargs: Any

Additional keyword arguments.

Returns#

np.ndarray or torch.Tensor or ScatteredVolume or ScatteredField

The blurred image, with the same shape and backend as the input.