i3dlib

Documentation

i3d::HRCA_LUT< ITYPE, OTYPE > Class Template Reference

class implements operations with LUT for unsigned numerical types (unsigned char and unsigned short) More...

#include <hrca_lut.h>

List of all members.


Public Member Functions

void CreateAffine (float a, float b, OTYPE min=std::numeric_limits< OTYPE >::min(), OTYPE max=std::numeric_limits< OTYPE >::max())
 creates affine LUT
void CreateLinearStretch (const HRCA_Histogram< ITYPE > &histogram)
 creates LUT for linear stretching
void CreatePercentileStretch (const HRCA_Histogram< ITYPE > &histogram, int lp, int rp)
 creates LUT for percentile stretching,
void CreateThresholding (ITYPE min_threshold, ITYPE max_threshold=std::numeric_limits< ITYPE >::max())
 creates LUT for thresholding
void CreateEqualization (const HRCA_Histogram< ITYPE > &histogram)
 creates LUT for histogram equalization
void CreateGamma (const HRCA_Histogram< ITYPE > &histogram, float gamma)
 creates LUT for gamma correction
void Apply (const ITYPE *idata, OTYPE *odata, long size) const
 applies LUT on data
OTYPE Get (ITYPE i) const
 get LUT value for given intensity

Protected Attributes

OTYPE * _lut
 LUT for conversion from ITYPE to OTYPE, size of LUT is _lut_size.
const long _lut_size
 size of LUT is equal to std::numeric_limits<ITYPE>::max() + 1

Detailed Description

template<class ITYPE, class OTYPE>
class i3d::HRCA_LUT< ITYPE, OTYPE >

class implements operations with LUT for unsigned numerical types (unsigned char and unsigned short)


Member Function Documentation

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreateAffine ( float  a,
float  b,
OTYPE  min = std::numeric_limits< OTYPE >::min(),
OTYPE  max = std::numeric_limits< OTYPE >::max() 
)

creates affine LUT

creates affine LUT, i.e. lut[i] = min_OTYPE if (a * in[i] + b) <= min_OTYPE lut[i] = max_OTYPE if (a * in[i] + b) >= max_OTYPE lut[i] = round(a * in[i] + b) otherwise where min_OTYPE and max_OTYPE are the minimal and the maximal output values. These values are implicitly set to std::numeric_limits<OTYPE>::min() and std::numeric_limits<OTYPE>::max().

Note: This function cannot be used for RGB images yet.

Parameters:
a 
b 

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreateLinearStretch ( const HRCA_Histogram< ITYPE > &  histogram  ) 

creates LUT for linear stretching

computes coefficients a and b for affine transformation so that the lowest value of input histogram is mapped to 0 and the highest value is mapped to maximal value of OTYPE

Parameters:
histogram histogram of ITYPE values, size of histogram is numeric_limits<ITYPE>::max()

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreatePercentileStretch ( const HRCA_Histogram< ITYPE > &  histogram,
int  lp,
int  rp 
)

creates LUT for percentile stretching,

same as linear stretch but certain amount of leftmost and rightmost histogram values is lost. you get linear stretching for lp = rp = 0;

Parameters:
histogram histogram of ITYPE values, size of histogram is numeric_limits<ITYPE>::max()

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreateThresholding ( ITYPE  min_threshold,
ITYPE  max_threshold = std::numeric_limits< ITYPE >::max() 
)

creates LUT for thresholding

Parameters:
threshold 

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreateEqualization ( const HRCA_Histogram< ITYPE > &  histogram  ) 

creates LUT for histogram equalization

Parameters:
histogram histogram of ITYPE values, size of histogram is numeric_limits<ITYPE>::max()
NOT IMPLEMENTED

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::CreateGamma ( const HRCA_Histogram< ITYPE > &  histogram,
float  gamma 
)

creates LUT for gamma correction

Parameters:
histogram 
gamma NOT IMPLEMENTED

template<class ITYPE, class OTYPE>
void i3d::HRCA_LUT< ITYPE, OTYPE >::Apply ( const ITYPE *  idata,
OTYPE *  odata,
long  size 
) const

applies LUT on data

Parameters:
data 
size size of data

template<class ITYPE, class OTYPE>
OTYPE i3d::HRCA_LUT< ITYPE, OTYPE >::Get ( ITYPE  i  )  const [inline]

get LUT value for given intensity

Parameters:
i 


The documentation for this class was generated from the following files: