lsst.pipe.tasks g2c21b0017a+4f59a27f16
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.

Definition at line 153 of file _local_contrast.py.

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.

Definition at line 206 of file _local_contrast.py.

◆ setDefaults()

None lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.setDefaults ( self)

Definition at line 197 of file _local_contrast.py.

Member Data Documentation

◆ clarity

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.clarity = Field[float](doc="Amount of clarity to apply to contrast modification", default=0.1)
static

Definition at line 182 of file _local_contrast.py.

◆ diffusionFunction

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

Definition at line 193 of file _local_contrast.py.

◆ doDiffusion

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.doDiffusion = Field[bool]("Run the diffusion function or not", default=True)
static

Definition at line 192 of file _local_contrast.py.

◆ 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"
),
)

Definition at line 172 of file _local_contrast.py.

◆ highlights

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.highlights = Field[float](doc="Adjustment factor for the highlights", default=-0.9)
static

Definition at line 180 of file _local_contrast.py.

◆ 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,
)

Definition at line 186 of file _local_contrast.py.

◆ shadows

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.shadows = Field[float](doc="Adjustment factor for the shadows", default=0.5)
static

Definition at line 181 of file _local_contrast.py.

◆ 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
)

Definition at line 183 of file _local_contrast.py.

◆ skipLevels

lsst.pipe.tasks.prettyPictureMaker._functors._local_contrast.LocalContrastEnhancer.skipLevels = Field[int]("Skip this many lowest levels in laplace pyramid", default=0)
static

Definition at line 191 of file _local_contrast.py.


The documentation for this class was generated from the following file: