mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
imageFilters.hpp File Reference

Image filters (smoothing, radial profiles, etc.). More...

Image filters (smoothing, radial profiles, etc.).

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

Definition in file imageFilters.hpp.

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <format>
#include <limits>
#include "../math/floatUtils.hpp"
#include "../math/gslInterpolator.hpp"
#include "../math/vectorUtils.hpp"
#include "../math/geo.hpp"
#include "imageMasks.hpp"

Go to the source code of this file.

Classes

struct  mx::improc::gaussKernel< _arrayT, _kernW, _verboseT >
 Symetric Gaussian smoothing kernel. More...
struct  mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >
 Azimuthally variable boxcar kernel. More...
struct  mx::improc::precalcKernel< kernelT >
 A kernel that is pre-calculated for the entire image, useful for repeated applications. More...

Namespaces

namespace  mx
 The mxlib c++ namespace.

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.
template<typename imageTout, typename imageTin>
int mx::improc::meanSmooth (imageTout &imOut, const imageTin &imIn, int meanFullWidth, bool rejectMinMax=false)
 Smooth an image using the mean in a rectangular box, optionally rejecting the highest and lowest values.
template<typename imageTout, typename imageTin>
int mx::improc::meanSmooth (imageTout &imOut, int &xMax, int &yMax, typename imageTout::Scalar &pMax, const imageTin &imIn, int meanFullWidth, bool rejectMinMax=false)
 Smooth an image using the mean in a rectangular box, optionally rejecting the highest and lowest values. Determines the location and value of the highest pixel.
template<typename imageTout, typename imageTin>
int mx::improc::medianSmooth (imageTout &imOut, int &xMax, int &yMax, typename imageTout::Scalar &pMax, const imageTin &imIn, int medianFullWidth)
template<typename imageTout, typename imageTin>
int mx::improc::medianSmooth (imageTout &imOut, const imageTin &imIn, int medianFullWidth)
 Smooth an image using the median in a rectangular box.
template<typename eigenImT>
void mx::improc::rowEdgeMedSubtract (eigenImT &im, int ncols)
template<typename eigenImT>
void mx::improc::colEdgeMedSubtract (eigenImT &im, int nrows)
template<typename vecT, typename eigenImT1, typename eigenImT2, typename eigenImT3>
void mx::improc::radprof (vecT &rad, vecT &prof, const eigenImT1 &im, const eigenImT2 &radim, const eigenImT3 *mask, bool mean=false, typename eigenImT1::Scalar minr=0)
 Calculate the the radial profile.
template<typename vecT, typename eigenImT1, typename eigenImT2>
void mx::improc::radprof (vecT &rad, vecT &prof, const eigenImT1 &im, const eigenImT2 &mask, bool mean=false)
 Calculate the the radial profile.
template<typename vecT, typename eigenImT1>
void mx::improc::radprof (vecT &rad, vecT &prof, const eigenImT1 &im, bool mean=false, double dr=1)
 Calculate the the radial profile.
template<typename radprofT, typename eigenImT1, typename eigenImT2, typename eigenImT3>
void mx::improc::radprofim (radprofT &radprofIm, eigenImT1 &im, const eigenImT2 &rad, const eigenImT3 *mask, bool subtract, bool mean=false)
 Form a radial profile image, and optionally subtract it from the input.
template<typename radprofT, typename eigenImT>
void mx::improc::radprofim (radprofT &radprof, eigenImT &im, bool subtract=false, bool mean=false)
 Form a radial profile image, and optionally subtract it from the input.
template<typename eigenImT, typename eigenImT1, typename eigenImT2, typename eigenImT3>
void mx::improc::stddevImage (eigenImT &stdIm, const eigenImT1 &im, const eigenImT2 &rad, const eigenImT3 &mask, typename eigenImT::Scalar minRad, typename eigenImT::Scalar maxRad, bool divide)
 Form a standard deviation image, and optionally normalize the input relative to the local mean to form a S/N map.
template<typename eigenImT, typename eigenImT1, typename eigenImT2>
void mx::improc::stddevImage (eigenImT &stdIm, const eigenImT1 &im, const eigenImT2 &mask, typename eigenImT::Scalar minRad, typename eigenImT::Scalar maxRad, bool divide=false)
 Form a standard deviation image, and optionally normalize the input relative to the local mean to form a S/N map.
template<typename eigenCubeT, typename eigenCubeT1, typename eigenCubeT2, typename radT1, typename radT2>
void mx::improc::stddevImageCube (eigenCubeT &stdImc, const eigenCubeT1 &imc, const eigenCubeT2 &maskCube, radT1 minRad, radT2 maxRad, bool divide=false)

Function Documentation

◆ colEdgeMedSubtract()

template<typename eigenImT>
void mx::improc::colEdgeMedSubtract ( eigenImT & im,
int nrows )
Parameters
imThe image to filter
nrowsThe number of rows on each side of the image to use as the reference

Definition at line 1101 of file imageFilters.hpp.

References mx::math::vectorMedian().

◆ rowEdgeMedSubtract()

template<typename eigenImT>
void mx::improc::rowEdgeMedSubtract ( eigenImT & im,
int ncols )
Parameters
imThe image to filter
ncolsThe number of columns on each side of the image to use as the reference

Definition at line 1074 of file imageFilters.hpp.

References mx::math::vectorMedian().