spyrit.misc.walsh_hadamard.walsh2_torch

spyrit.misc.walsh_hadamard.walsh2_torch(im, H=None)[source]

Return 2D Walsh-ordered Hadamard transform of an image

Args:

im (torch.tensor): Image, typically a B-by-C-by-W-by-H Tensor H (torch.tensor, optional): 1D Walsh-ordered Hadamard transformation matrix. A 2-D tensor of size W-by-H.

Returns:

torch.tensor: Hadamard transformed image. Same size as im

..warning::

This function is deprecated and has been moved to spyrit.core.torch. It is recommended to use spyrit.core.torch.fwht_2d() instead for natural- or walsh-ordered Hadamard transforms.

Examples:
>>> im = torch.randn(256, 1, 64, 64)
>>> had = walsh2_torch(im)