PICCANTE  0.4
The hottest HDR imaging library!
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
pic::CameraResponseFunction Class Reference

The CameraResponseFunction class. More...

#include <camera_response_function.hpp>

Public Member Functions

 CameraResponseFunction ()
 CameraResponseFunction. More...
 
 ~CameraResponseFunction ()
 
float remove (float x, int channel)
 remove linearizes a camera value using the inverse CRF. More...
 
float apply (float x, int channel)
 apply More...
 
void setCRFtoGamma2_2 ()
 setCRFtoGamma2_2 More...
 
void setCRFtoLinear ()
 setCRFtoLinear More...
 
void fromRAWJPEG (Image *img_raw, Image *img_jpg, int filteringSize=11)
 FromRAWJPEG computes the CRF by exploiting the couple RAW/JPEG from cameras. More...
 
void DebevecMalik (ImageVec stack, CRF_WEIGHT type=CW_DEB97, int nSamples=256, float lambda=20.0f)
 DebevecMalik computes the CRF of a camera using multiple exposures value following Debevec and Malik 1997's method. More...
 
bool MitsunagaNayar (ImageVec &stack, int polynomial_degree=-3, int nSamples=256, const bool full=false, const float alpha=0.04f, const bool computeRatios=false, const float eps=0.0001f, const std::size_t max_iterations=100)
 MitsunagaNayar computes the inverse CRF of a camera as a polynomial function. More...
 
void Robertson (ImageVec &stack, const size_t maxIterations=50)
 Robertson computes the CRF of a camera using all multiple exposures value Robertson et al 1999's method (Dynamic range improvement through multiple exposures). More...
 

Public Attributes

std::vector< float * > icrf
 
std::vector< float * > crf
 
std::vector< Polynomialpoly
 

Protected Member Functions

float * gsolve (int *samples, std::vector< float > &log_exposure, float lambda, int nSamples)
 gsolve computes the inverse CRF of a camera. More...
 
void release ()
 release frees memory. More...
 
void createTabledICRF ()
 createTabledICRF More...
 

Protected Attributes

SubSampleStack stackOut
 
IMG_LIN type_linearization
 
float w [256]
 

Detailed Description

The CameraResponseFunction class.

Constructor & Destructor Documentation

◆ CameraResponseFunction()

pic::CameraResponseFunction::CameraResponseFunction ( )
inline

◆ ~CameraResponseFunction()

pic::CameraResponseFunction::~CameraResponseFunction ( )
inline

Member Function Documentation

◆ apply()

float pic::CameraResponseFunction::apply ( float  x,
int  channel 
)
inline

apply

Parameters
xa value in [0, 1]
channel
Returns

◆ createTabledICRF()

void pic::CameraResponseFunction::createTabledICRF ( )
inlineprotected

createTabledICRF

◆ DebevecMalik()

void pic::CameraResponseFunction::DebevecMalik ( ImageVec  stack,
CRF_WEIGHT  type = CW_DEB97,
int  nSamples = 256,
float  lambda = 20.0f 
)
inline

DebevecMalik computes the CRF of a camera using multiple exposures value following Debevec and Malik 1997's method.

Parameters
stack
exposure
type
nSamples
lambda

◆ fromRAWJPEG()

void pic::CameraResponseFunction::fromRAWJPEG ( Image img_raw,
Image img_jpg,
int  filteringSize = 11 
)
inline

FromRAWJPEG computes the CRF by exploiting the couple RAW/JPEG from cameras.

Parameters
img_rawis a RAW image.
img_jpgis a JPEG compressed image.
filteringSize

◆ gsolve()

float* pic::CameraResponseFunction::gsolve ( int *  samples,
std::vector< float > &  log_exposure,
float  lambda,
int  nSamples 
)
inlineprotected

gsolve computes the inverse CRF of a camera.

◆ MitsunagaNayar()

bool pic::CameraResponseFunction::MitsunagaNayar ( ImageVec stack,
int  polynomial_degree = -3,
int  nSamples = 256,
const bool  full = false,
const float  alpha = 0.04f,
const bool  computeRatios = false,
const float  eps = 0.0001f,
const std::size_t  max_iterations = 100 
)
inline

MitsunagaNayar computes the inverse CRF of a camera as a polynomial function.

Parameters
stackArray of images with associated exposure. Note that this array will be sorted with increasing exposure.
polynomial_degreeDegree of the polynomial. If negative, the best degree will be selected in [1, -polynomial_degree] for each channel.
nSamplesNumber of samples to extract from each image.
fulltrue for computing all exposure ratios (as in book "High Dynamic Range Imaging", second edition, Reinhard et al.), false as in the original paper (only among successive exposures).
alphaThreshold for removing samples with values not in [alpha, 1-alpha].
computeRatiosfalse if exact exposures are passed, true to approximate exposure ratios as in the paper.
epsThreshold on the difference among successive approximations for stopping the computation.
max_iterationsStop the computation after this number of iterations.
Returns
true if successfully computed, false otherwise.

◆ release()

void pic::CameraResponseFunction::release ( )
inlineprotected

release frees memory.

◆ remove()

float pic::CameraResponseFunction::remove ( float  x,
int  channel 
)
inline

remove linearizes a camera value using the inverse CRF.

Parameters
xis an intensity value in [0,1].
channel
Returns
It returns x in the linear domain.

◆ Robertson()

void pic::CameraResponseFunction::Robertson ( ImageVec stack,
const size_t  maxIterations = 50 
)
inline

Robertson computes the CRF of a camera using all multiple exposures value Robertson et al 1999's method (Dynamic range improvement through multiple exposures).

Parameters
stack
maxIterations

◆ setCRFtoGamma2_2()

void pic::CameraResponseFunction::setCRFtoGamma2_2 ( )
inline

setCRFtoGamma2_2

◆ setCRFtoLinear()

void pic::CameraResponseFunction::setCRFtoLinear ( )
inline

setCRFtoLinear

Member Data Documentation

◆ crf

std::vector<float *> pic::CameraResponseFunction::crf

◆ icrf

std::vector<float *> pic::CameraResponseFunction::icrf

◆ poly

std::vector< Polynomial > pic::CameraResponseFunction::poly

◆ stackOut

SubSampleStack pic::CameraResponseFunction::stackOut
protected

◆ type_linearization

IMG_LIN pic::CameraResponseFunction::type_linearization
protected

◆ w

float pic::CameraResponseFunction::w[256]
protected

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