lsst.afw g1f6fc4ca13+8b5155b42b
Classes | Functions
lsst::afw::math::detail Namespace Reference

Classes

struct  ConvolveWithInterpolationWorkingImages
 kernel images used by convolveRegionWithInterpolation More...
 
class  KernelImagesForRegion
 A collection of Kernel images for special locations on a rectangular region of an image. More...
 
class  RowOfKernelImagesForRegion
 A row of KernelImagesForRegion. More...
 
class  SmoothedSpline
 
class  Spline
 
class  TautSpline
 
struct  TrapezoidalPacker
 A helper class ChebyshevBoundedField, for mapping trapezoidal matrices to 1-d arrays. More...
 
class  WarpAtOnePoint
 A functor that computes one warped pixel. More...
 

Functions

template<typename OutImageT , typename InImageT >
void basicConvolve (OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
 Low-level convolution function that does not set edge pixels. More...
 
template<typename OutImageT , typename InImageT >
void basicConvolve (OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::DeltaFunctionKernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
 A version of basicConvolve that should be used when convolving delta function kernels. More...
 
template<typename OutImageT , typename InImageT >
void basicConvolve (OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::LinearCombinationKernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
 A version of basicConvolve that should be used when convolving a LinearCombinationKernel. More...
 
template<typename OutImageT , typename InImageT >
void basicConvolve (OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::SeparableKernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
 A version of basicConvolve that should be used when convolving separable kernels. More...
 
template<typename OutImageT , typename InImageT >
void convolveWithBruteForce (OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
 Convolve an Image or MaskedImage with a Kernel by computing the kernel image at every point. More...
 
template<typename OutImageT , typename InImageT >
void convolveWithInterpolation (OutImageT &outImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, ConvolutionControl const &convolutionControl)
 Convolve an Image or MaskedImage with a spatially varying Kernel using linear interpolation. More...
 
template<typename OutImageT , typename InImageT >
void convolveRegionWithInterpolation (OutImageT &outImage, InImageT const &inImage, KernelImagesForRegion const &region, ConvolveWithInterpolationWorkingImages &workingImages)
 Convolve a region of an Image or MaskedImage with a spatially varying Kernel using interpolation. More...
 

Function Documentation

◆ basicConvolve() [1/4]

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::basicConvolve ( OutImageT &  convolvedImage,
InImageT const &  inImage,
lsst::afw::math::DeltaFunctionKernel const &  kernel,
lsst::afw::math::ConvolutionControl const &  convolutionControl 
)

A version of basicConvolve that should be used when convolving delta function kernels.

Parameters
[out]convolvedImageconvolved image
[in]inImageimage to convolve
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters

Definition at line 181 of file BasicConvolve.cc.

◆ basicConvolve() [2/4]

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::basicConvolve ( OutImageT &  convolvedImage,
InImageT const &  inImage,
lsst::afw::math::Kernel const &  kernel,
lsst::afw::math::ConvolutionControl const &  convolutionControl 
)

Low-level convolution function that does not set edge pixels.

convolvedImage must be the same size as inImage. convolvedImage has a border in which the output pixels are not set. This border has size:

  • kernel.getCtr().getX() along the left edge
  • kernel.getCtr().getY() along the bottom edge
  • kernel.getWidth() - 1 - kernel.getCtr().getX() along the right edge
  • kernel.getHeight() - 1 - kernel.getCtr().getY() along the top edge
Parameters
[out]convolvedImageconvolved image
[in]inImageimage to convolve
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif convolvedImage dimensions != inImage dimensions
lsst::pex::exceptions::InvalidParameterErrorif inImage smaller than kernel in width or height
lsst::pex::exceptions::InvalidParameterErrorif kernel width or height < 1
std::bad_allocwhen allocation of CPU memory fails

Definition at line 141 of file BasicConvolve.cc.

◆ basicConvolve() [3/4]

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::basicConvolve ( OutImageT &  convolvedImage,
InImageT const &  inImage,
lsst::afw::math::LinearCombinationKernel const &  kernel,
lsst::afw::math::ConvolutionControl const &  convolutionControl 
)

A version of basicConvolve that should be used when convolving a LinearCombinationKernel.

The Algorithm:

  • If the kernel is spatially varying and contains only DeltaFunctionKernels then convolves the input Image by each basis kernel in turn, solves the spatial model for that component and adds in the appropriate amount of the convolved image.
  • In all other cases uses normal convolution
Parameters
[out]convolvedImageconvolved image
[in]inImageimage to convolve
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif convolvedImage dimensions != inImage dimensions
lsst::pex::exceptions::InvalidParameterErrorif inImage smaller than kernel in width or height
lsst::pex::exceptions::InvalidParameterErrorif kernel width or height < 1
std::bad_allocwhen allocation of CPU memory fails

Definition at line 209 of file BasicConvolve.cc.

◆ basicConvolve() [4/4]

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::basicConvolve ( OutImageT &  convolvedImage,
InImageT const &  inImage,
lsst::afw::math::SeparableKernel const &  kernel,
lsst::afw::math::ConvolutionControl const &  convolutionControl 
)

A version of basicConvolve that should be used when convolving separable kernels.

Parameters
[out]convolvedImageconvolved image
[in]inImageimage to convolve
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters

Definition at line 246 of file BasicConvolve.cc.

◆ convolveRegionWithInterpolation()

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::convolveRegionWithInterpolation ( OutImageT &  outImage,
InImageT const &  inImage,
KernelImagesForRegion const &  region,
ConvolveWithInterpolationWorkingImages workingImages 
)

Convolve a region of an Image or MaskedImage with a spatially varying Kernel using interpolation.

This is a low-level convolution function that does not set edge pixels.

Parameters
[out]outImageconvolved image = inImage convolved with kernel
[in]inImageinput image
[in]regionkernel image region over which to convolve
[in]workingImagesworking kernel images
Warning
: this is a low-level routine that performs no bounds checking.

Definition at line 88 of file ConvolveWithInterpolation.cc.

◆ convolveWithBruteForce()

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::convolveWithBruteForce ( OutImageT &  convolvedImage,
InImageT const &  inImage,
lsst::afw::math::Kernel const &  kernel,
lsst::afw::math::ConvolutionControl const &  convolutionControl 
)

Convolve an Image or MaskedImage with a Kernel by computing the kernel image at every point.

(If the kernel is not spatially varying then only compute it once).

convolvedImage must be the same size as inImage. convolvedImage has a border in which the output pixels are not set. This border has size:

  • kernel.getCtr().getX() along the left edge
  • kernel.getCtr().getY() along the bottom edge
  • kernel.getWidth() - 1 - kernel.getCtr().getX() along the right edge
  • kernel.getHeight() - 1 - kernel.getCtr().getY() along the top edge
Parameters
[out]convolvedImageconvolved image
[in]inImageimage to convolve
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif convolvedImage dimensions != inImage dimensions
lsst::pex::exceptions::InvalidParameterErrorif inImage smaller than kernel in width or height
lsst::pex::exceptions::InvalidParameterErrorif kernel width or height < 1
std::bad_allocwhen allocation of CPU memory fails
Warning
Low-level convolution function that does not set edge pixels.

Definition at line 355 of file BasicConvolve.cc.

◆ convolveWithInterpolation()

template<typename OutImageT , typename InImageT >
void lsst::afw::math::detail::convolveWithInterpolation ( OutImageT &  outImage,
InImageT const &  inImage,
lsst::afw::math::Kernel const &  kernel,
math::ConvolutionControl const &  convolutionControl 
)

Convolve an Image or MaskedImage with a spatially varying Kernel using linear interpolation.

This is a low-level convolution function that does not set edge pixels.

The algorithm is as follows:

  • divide the image into regions whose size is no larger than maxInterpolationDistance
  • for each region:
    • convolve it using convolveRegionWithInterpolation (which see)

Note that this routine will also work with spatially invariant kernels, but not efficiently.

Parameters
[out]outImageconvolved image = inImage convolved with kernel
[in]inImageinput image
[in]kernelconvolution kernel
[in]convolutionControlconvolution control parameters
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif outImage is not the same size as inImage

Definition at line 45 of file ConvolveWithInterpolation.cc.