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

Using the Eigen matrix library for image processing

Classes

class  mx::improc::eigenCube< dataT >
 An image cube with an Eigen-like API. More...
 
struct  mx::improc::is_eigenCube< T >
 Test whether a type is an eigenCube by testing whether it has a typedef of "is_eigenCube". More...
 
struct  mx::improc::eigenArrPlanes< arrT, isCube >
 Function object to return the number of planes for any Eigen like object, whether 2D or a 3D cube. More...
 
class  mx::improc::milkImage< _dataT >
 Class to interface with an ImageStreamIO image in shared memory. More...
 

Typedefs

template<typename scalarT >
using mx::improc::eigenImage = Eigen::Array< scalarT, -1, -1 >
 Definition of the eigenImage type, which is an alias for Eigen::Array. More...
 
template<typename scalarT >
using mx::improc::eigenMap = Eigen::Map< Eigen::Array< scalarT, -1, -1 > >
 Definition of the eigenMap type, which is an alias for Eigen::Map<Array>. More...
 

Functions

template<typename imageT , typename maskT = imageT>
imageT::Scalar mx::improc::imageMedian (const imageT &mat, const maskT *mask, std::vector< typename imageT::Scalar > *work=0)
 Calculate the median of an Eigen-like array. More...
 
template<typename imageT >
imageT::Scalar mx::improc::imageMedian (const imageT &mat, std::vector< typename imageT::Scalar > *work=0)
 Calculate the median of an Eigen-like array. More...
 

Typedef Documentation

◆ eigenImage

template<typename scalarT >
using mx::improc::eigenImage = typedef Eigen::Array<scalarT, -1, -1>

Definition of the eigenImage type, which is an alias for Eigen::Array.

Definition at line 44 of file eigenImage.hpp.

◆ eigenMap

template<typename scalarT >
using mx::improc::eigenMap = typedef Eigen::Map<Eigen::Array<scalarT, -1, -1> >

Definition of the eigenMap type, which is an alias for Eigen::Map<Array>.

Definition at line 50 of file eigenImage.hpp.

Function Documentation

◆ imageMedian() [1/2]

template<typename imageT , typename maskT = imageT>
imageT::Scalar mx::improc::imageMedian ( const imageT &  mat,
const maskT *  mask,
std::vector< typename imageT::Scalar > *  work = 0 
)

Calculate the median of an Eigen-like array.

Calculates the median of the entire array, allowing for some pixels to be ignored using a mask. Working memory can be retained between calls.

Template Parameters
imageTis an Eigen-like type
maskTis an Eigen-like type
Returns
the median of the unmasked pixels of mat, using vectorMedianInPlace().
Parameters
[in]matthe image to take the median of
[in]maskif non-0, a 1/0 mask where 0 pixels are ignored.
[in]work[optional] working memory can be retained and re-passed. Is resized.

Definition at line 122 of file eigenImage.hpp.

References mx::math::vectorMedianInPlace().

◆ imageMedian() [2/2]

template<typename imageT >
imageT::Scalar mx::improc::imageMedian ( const imageT &  mat,
std::vector< typename imageT::Scalar > *  work = 0 
)

Calculate the median of an Eigen-like array.

Calculates the median of the entire array. Working memory can be retained between calls.

Template Parameters
imageTis an Eigen-like type
Returns
the median of the unmasked pixels of mat, using vectorMedianInPlace().
Parameters
[in]matthe image to take the median of
[in]work[optional] working memory can be retained and re-passed.

Definition at line 180 of file eigenImage.hpp.