ImageConvolver.h

Classes

ImageConvolver -- This class does convolution of an image by an Array or Lattice (full description)

template <class T> class ImageConvolver

Types

enum ScaleTypes

NONE
None; neither autoscaling nor direct scaling
AUTOSCALE
Autoscale (normalize kernel to unit sum)
SCALE
SCALE (apply given scale factor)
NTypes
Number

Interface

Public Members
ImageConvolver ()
ImageConvolver(const ImageConvolver<T> &other)
~ImageConvolver()
ImageConvolver &operator=(const ImageConvolver<T> &other)
void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const ImageInterface<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous, Bool warnOnly)
void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const T<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous)
void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const T<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous)
Private Members
void makeMask(ImageInterface<T>& out, T& os) const
void checkCoordinates (LogIO& os, const CoordinateSystem& cSysImage, const CoordinateSystem& cSysKernel, Bool warnOnly) const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class handles convolution of images by an Array or Lattice

Synopsis

This class convolves an image by a specified kernel (Array or Lattice). If the kernel does not have enough dimensions, degenerate ones are added.The class object has no state. The functions could be static. The convolution is done via FFT. Thus input pixels which are masked are set to 0 before the convolution. The mask is transferred to the output image. No additional scaling of the output image values is done.

Example


 

Motivation

Convolution is a standard image processing requirement.

To Do

Member Description

enum ScaleTypes

ImageConvolver ()

Constructor

ImageConvolver(const ImageConvolver<T> &other)

Copy constructor. Uses reference semantics.

~ImageConvolver()

Destructor

ImageConvolver &operator=(const ImageConvolver<T> &other)

Assignment operator. Uses reference semantics.

void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const ImageInterface<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous, Bool warnOnly)
void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const T<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous)
void convolve(LogIO& os, ImageInterface<T>& imageOut, ImageInterface<T>& imageIn, const T<T>& kernel, ScaleTypes scaleType, Double scale, Bool copyMiscellaneous)

Convolve by an Image, Lattice or Array. If convolving by an image some rudimentary coordinate checks are made and warnings optionally issued (warnOnly) if things are not commensurate. If the output image needs a mask and doesn't have one, it will be given one if possible. The input mask is transferred to the output. The miscInfo, imageInfo, units and logger will be copied from the input to the output unless you indicate not to (copyMiscellaneous). Any restoring beam is deleted from the output image ImageInfo object. The input CoordinateSystem is transferred to the output image. Degenerate axes are added to the kernel if it does not have enough dimensions. If autoScale is true, the kernel is normalized to have unit sum. Otherwise, the kernel is scaled (multiplied) by the value scale

void makeMask(ImageInterface<T>& out, T& os) const

Make mask for image

void checkCoordinates (LogIO& os, const CoordinateSystem& cSysImage, const CoordinateSystem& cSysKernel, Bool warnOnly) const

Check Coordinates of kernel and image