mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]

Image filtering with a kernel.

Classes

struct  mx::improc::gaussKernel< _arrayT, _kernW >
 Symetric Gaussian smoothing kernel. More...
 
struct  mx::improc::azBoxKernel< _arrayT, _kernW >
 Azimuthally variable boxcare kernel. More...
 

Functions

template<typename imageOutT , typename imageInT , typename kernelT >
void mx::improc::filterImage (imageOutT &fim, imageInT im, kernelT kernel, int maxr=0)
 Filter an image with a mean kernel. More...
 

Function Documentation

◆ filterImage()

template<typename imageOutT , typename imageInT , typename kernelT >
void mx::improc::filterImage ( imageOutT &  fim,
imageInT  im,
kernelT  kernel,
int  maxr = 0 
)

Filter an image with a mean kernel.

Applies the kernel to each pixel in the image and sums, storing the filtered result in the output image. The kernel-type (kernelT) must have the following interface:

template<typename _arrayT, size_t kernW>
struct filterKernel
{
typedef _arrayT arrayT; // arrayT must have an eigen-like interface
typedef typename _arrayT::Scalar arithT;
filterKernel()
{
//constructor
}
//The maxWidth function returns the maximum possible full-width (in either direction) of the kernel
//Called once
int maxWidth()
{
//returns the maximum half-width given the configuration
}
//The setKernel function is called for each pixel.
void setKernel(arithT x, arithT y, arrayT & kernel)
{
//This must resize and populate the passed in kernel array each time
//so that it is re-entrant.
//Note: On output kernel array should be normalized so that sum() = 1.0
//Note: the width and height of the kernel array should always be odd
}
};
Parameters
[out]fimwill be allocated with resize, and on output contains the filtered image
[in]imis the image to be filtered
[in]kernela fully configured obect of type kernelT
[in]maxris the maximum radius from the image center to apply the kernel. pixels outside this radius are set to 0.
Template Parameters
imageOutTthe type of the output image (must have an Eigen like interface)
imageInTthe type of the input image (must have an Eigen like interface)
kernelTis the kernel type (see above)

Definition at line 277 of file imageFilters.hpp.

Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::HCIobservation< _realT >::preProcess().