|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Image filtering with a kernel.
The filter function use a kernel that specifies how to filter the image. Filter kernels, usually denoted as type kernelT below, must have the following interface:
Additionally kernelT must be copyable.
/ / Symetric Gaussian smoothing kernel /**
Classes | |
| struct | mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT > |
| Azimuthally variable boxcar kernel. More... | |
Functions | |
| template<typename imageOutT , typename imageInT , typename kernelT > | |
| error_t | mx::improc::filterImage (imageOutT &fim, imageInT im, const kernelT &kernel, int maxr=0) |
| Filter an image with a mean kernel. | |
| template<typename imageOutT , typename imageInT , typename kernelT > | |
| void | mx::improc::medianFilterImage (imageOutT &fim, imageInT im, const kernelT &kernel, int maxr=0, int maxrproc=1) |
| Filter an image with a median kernel. | |
| error_t mx::improc::filterImage | ( | imageOutT & | fim, |
| imageInT | im, | ||
| const 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.
| imageOutT | the type of the output image (must have an Eigen-like interface) |
| imageInT | the type of the input image (must have an Eigen-like interface) |
| kernelT | is the kernel type (see above for requirements) |
| [out] | fim | Contains the filtered image, will be resized |
| [in] | im | the image to be filtered |
| [in] | kernel | a fully configured kernel object |
| [in] | maxr | [opt] the maximum radius from the image center to apply the kernel. pixels outside this radius are set to 0. |
Definition at line 395 of file imageFilters.hpp.
References mx::noerror.
Referenced by mx::AO::applyPupil2Basis(), and mx::improc::imCenterCircleSym< realT >::center().
| void mx::improc::medianFilterImage | ( | imageOutT & | fim, |
| imageInT | im, | ||
| const kernelT & | kernel, | ||
| int | maxr = 0, |
||
| int | maxrproc = 1 |
||
| ) |
Filter an image with a median kernel.
Calculates the median of all pixels corresponding to non-zero pixels in the kernel, storing the filtered result in the output image.
| imageOutT | the type of the output image (must have an Eigen-like interface) |
| imageInT | the type of the input image (must have an Eigen-like interface) |
| kernelT | is the kernel type (see above for requirements) |
| [out] | fim | Contains the filtered image, will be resized |
| [in] | im | the image to be filtered |
| [in] | kernel | a fully configured kernel object |
| [in] | maxr | [opt] the maximum radius from the image center to apply the kernel. Psixels outside this radius are set to 0. |
Definition at line 540 of file imageFilters.hpp.
References mx::math::vectorMedianInPlace().