lsst.pipe.tasks gcf790cdeb6+0604939b8f
Loading...
Searching...
No Matches
lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator Class Reference

Public Member Functions

None __init__ (self, int patch_grow, int bin_factor=1)
 
None add_to_image (self, NDArray image, NDArray patch, Box2I newBox, Box2I box, bool reverse=True)
 

Public Attributes

 patch_grow = patch_grow
 
 bin_factor = bin_factor
 
list featherings = None
 

Protected Member Functions

None _make_featherings (self, tuple[int, int] dimensions)
 

Detailed Description

Create feathering masks for seamless image patch blending.

This class generates feathering masks used to smoothly blend image patches
into a larger mosaic. The feathering gradually transitions from full opacity
to zero opacity across the patch boundaries, reducing visible seams.

Parameters
----------
patch_grow : `int`
    Number of pixels to grow the patch boundaries for feathering.
bin_factor : `int`, optional
    Binning factor for the feathering calculation. Reduces resolution
    of feathering masks for faster computation. Default is 1.

Notes
-----
The feathering masks are created as linear ramps from 0 to 1 (or 1 to 0)
over the `patch_grow` distance. The masks are stored in `self.featherings`
as a list of arrays in the order: [top, bottom, left, right].

Definition at line 32 of file _utils.py.

Constructor & Destructor Documentation

◆ __init__()

None lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator.__init__ ( self,
int patch_grow,
int bin_factor = 1 )

Definition at line 54 of file _utils.py.

Member Function Documentation

◆ _make_featherings()

None lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator._make_featherings ( self,
tuple[int, int] dimensions )
protected
Create feathering masks for all edges of the patch.

Parameters
----------
dimensions : `tuple` of `int`
    Shape of the patch (height, width) for which to create feathering masks.

Notes
-----
This method creates four feathering masks (top, bottom, left, right) using
linear ramps from 0 to 1 (or 1 to 0) over the `patch_grow` distance. The
featherings are stored in `self.featherings` as a list of arrays.

Definition at line 59 of file _utils.py.

◆ add_to_image()

None lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator.add_to_image ( self,
NDArray image,
NDArray patch,
Box2I newBox,
Box2I box,
bool reverse = True )
Add a patch to an image with feathering at the edges.

Parameters
----------
image : `NDArray`
    Target image to which the patch will be added. Modified in-place.
patch : `NDArray`
    Patch array to be added to the image.
newBox : `Box2I`
    New bounding box position of the patch.
box : `Box2I`
    Original bounding box position of the patch.
reverse : `bool`, optional
    If True, reverse the patch along the first axis before adding.
    Default is True.

Notes
-----
This method applies feathering to smoothly blend the patch into the image
at the edges where the patch overlaps with existing image content. The
feathering is applied based on which edges of the patch differ between
`box` and `newBox`. The patch is multiplied by a mixer array that gradually
transitions from 0 to 1 across the feathering region.

Definition at line 100 of file _utils.py.

Member Data Documentation

◆ bin_factor

lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator.bin_factor = bin_factor

Definition at line 56 of file _utils.py.

◆ featherings

list lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator.featherings = None

Definition at line 57 of file _utils.py.

◆ patch_grow

lsst.pipe.tasks.prettyPictureMaker._utils.FeatheredMosaicCreator.patch_grow = patch_grow

Definition at line 55 of file _utils.py.


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