lsst.pipe.tasks gd5638573c2+392ae78cd2
Loading...
Searching...
No Matches
lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer Class Reference
Inheritance diagram for lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer:

Public Member Functions

None setDefaults (self)
FloatImagePlane __call__ (self, FloatImagePlane intensities)

Static Public Attributes

 doLocalContrast
 highlights = Field[float](doc="Adjustment factor for the highlights", default=-0.9)
 shadows = Field[float](doc="Adjustment factor for the shadows", default=0.5)
 clarity = Field[float](doc="Amount of clarity to apply to contrast modification", default=0.1)
 sigma
 maxLevel
 skipLevels = Field[int]("Skip this many lowest levels in laplace pyramid", default=0)
 doDiffusion = Field[bool]("Run the diffusion function or not", default=True)
 diffusionFunction

Detailed Description

Multi-stage local contrast enhancement processor.

Notes
-----
This class implements a two-stage approach for enhancing image contrast:

1. **Local Contrast Enhancement**: Applies scale-space contrast enhancement
   using a Laplacian pyramid approach. This adjusts highlights, shadows,
   and clarity while operating on multiple resolution levels.

2. **Anisotropic Diffusion**: Optionally applies wavelet-based anisotropic
   diffusion to further sharpen details and preserve edges. This stage
   selectively smooths regions based on local gradient information.

The processing pipeline is configurable via parameters for both stages,
allowing fine-tuned control over the enhancement behavior.

Member Function Documentation

◆ __call__()

FloatImagePlane lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.__call__ ( self,
FloatImagePlane intensities )
Apply multi-stage contrast enhancement to the input image.

Parameters
----------
intensities : `FloatImagePlane`
    The input intensity image to process.

Returns
-------
result : `FloatImagePlane`
    The enhanced intensity image with improved local contrast.

Notes
-----
This method implements a two-stage enhancement pipeline:

1. **Local Contrast Enhancement** (via `localContrast`):
   - Builds a Laplacian pyramid of the input image
   - Applies scale-dependent contrast modifications
   - Adjusts highlights and shadows via `highlights` and `shadows`
   - Controls clarity and sharpness via `clarity` parameter
   - Operates over `maxLevel` scales, skipping `skipLevels` lowest
   - Uses `sigma` to define what is considered "local"

2. **Anisotropic Diffusion** (optional, via `diffusionFunction`):
   - Applied only if `doDiffusion=True`
   - Performs wavelet-based anisotropic diffusion
   - Preserves edges while enhancing details
   - Configurable via diffusionFunction parameters

The two stages are applied sequentially, with the diffusion stage
operating on the locally enhanced image to further refine details.

Member Data Documentation

◆ diffusionFunction

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.diffusionFunction
static
Initial value:
= ConfigurableActionField[DiffusionFunction](
doc="Diffusion function to enhance local contrast",
)

◆ doLocalContrast

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.doLocalContrast
static
Initial value:
= Field[bool](
"Do apply local contrast",
default=True,
deprecated=(
"This will stop working in v31 and be removed in v32, please set doLocalContrast on"
" PrettyPictureConfig"
),
)

◆ maxLevel

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.maxLevel
static
Initial value:
= Field[int](
doc="The maximum number of scales the contrast should be enhanced over, if None then all",
default=4,
optional=True,
)

◆ sigma

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.sigma
static
Initial value:
= Field[float](
doc="The scale size of what is considered local in the contrast enhancement", default=30
)

The documentation for this class was generated from the following file:
  • python/lsst/pipe/tasks/prettyPictureMaker/_functors/_local_contrast.py