plenoptic.process.local_gain_control_dict#

plenoptic.process.local_gain_control_dict(coeff_dict, residuals=True)[source]#

Spatially local gain control, for each element in a dictionary.

For more details, see local_gain_control.

Parameters:
  • coeff_dict (dict) – A dictionary containing tensors of shape (batch, channel, height, width) or (batch, channel, angle, height, width).

  • residuals (bool (default: True)) – An option to carry around residuals in the energy dict. Note that the transformation is not applied to the residuals, that is dictionary elements with a key starting in “residual”.

Return type:

tuple[dict, dict]

Returns:

  • energy – The dictionary of torch.Tensor containing the local energy of x. Tensor shapes match those found in coeff_dict.

  • state – The dictionary of torch.Tensor containing the local phase of x. Tensor shapes match those found in coeff_dict.

Raises:

ValueError – If the tensors contained within coeff_dict do not have 4 or 5 dimensions.

See also

local_gain_control

Same operation on tensors.

local_gain_release_dict

The inverse operation.

rectangular_to_polar_dict

The analogous function for complex-valued signals.

Notes

Note that energy and state are not computed on the residuals.

Examples

>>> import plenoptic as po
>>> img = po.data.einstein()
>>> spyr = po.process.SteerablePyramidFreq(img.shape[-2:], height=3)
>>> coeffs = spyr(img)
>>> energy, state = po.process.local_gain_control_dict(coeffs)
>>> po.plot.pyrshow(energy)
<PyrFigure size ...>
>>> po.plot.pyrshow(state)
<PyrFigure size ...>
../../_images/plenoptic-process-local_gain_control_dict-1_00.png

Fig. 13 (png, hires.png, pdf)#

../../_images/plenoptic-process-local_gain_control_dict-1_01.png

Fig. 14 (png, hires.png, pdf)#