The Flutter Shutter Code Optimizer
Defines | Functions
best_snapshot_average.cpp File Reference

Routines for best snapshot on average computation. It finds the best exposure time for the standard camera assuming a motion model by minimizing : E()={-}^{}{^2}{sin^2({ v }{2})} {v^2 }{4}(v) d dv. More...

#include <math.h>
#include "best_snapshot_average.h"
Include dependency graph for best_snapshot_average.cpp:

Go to the source code of this file.

Defines

#define eps   0.001
#define ABS(x)   (((x) > 0) ? (x) : (-(x)))
#define M_PI   3.14159265358979323846

Functions

double best_snapshot_average (int flag_motion_model, double s, double proba_handcrafted_0)
double best_snapshot_average_energy (double deltat, int flag_motion_model, double s, double proba_handcrafted_0)
 Given a motion model compute the energy (noiseness on average of the restored taking the deconvolution into account). This fucntion computes : E()= E_v() (v) dv = {-}^{}{^2}{sin^2({ v }{2})} {v^2 }{4}(v) d dv. In other words using a snapshot with exposure time deltat and assuming a motion model will multiply the noise by a best_snapshot_average_energy(deltat, flag_motion_model, s) factor (on average on v).
double best_snapshot_average_integrand (double v, double deltat)
 Given a motion model compute the energy (noiseness of the restored after deconvolution) In other words using a snapshot with exposure time deltat at velocity v will multiply the noise by a best_snapshot_average_integrand( v, deltat) factor on average (on ). This is the energy E_v()= {-}^{){4 ^2v^2}{sin^2({}{2})}d.
double best_snapshot_integrand (double xi, double v, double deltat)
 Given a frequency, a velocity, an exposure time compute the noise multiplication factor In orther words using snaphot with exposure time of deltat at velocity v will multiply the noise of the frequency xi b y best_snapshot_integrand( xi, v, deltat):= {4 ^2 v^2 }{sin^2({ v }{2})}.
double proba_motion_model (double v, double s, double proba_handcrafted_0, int flag_motion_model)
 Given a motion model compute the probability of the velocity v ((v))

Detailed Description

Routines for best snapshot on average computation. It finds the best exposure time for the standard camera assuming a motion model by minimizing : E()={-}^{}{^2}{sin^2({ v }{2})} {v^2 }{4}(v) d dv.

Author:
Yohann Tendero <tendero@math.ucla.edu>

Definition in file best_snapshot_average.cpp.


Define Documentation

#define ABS (   x)    (((x) > 0) ? (x) : (-(x)))

absolute value definition.

Definition at line 41 of file best_snapshot_average.cpp.

#define eps   0.001

Definition at line 34 of file best_snapshot_average.cpp.

#define M_PI   3.14159265358979323846

M_PI is a POSIX definition for Pi

Definition at line 48 of file best_snapshot_average.cpp.


Function Documentation

double best_snapshot_average ( int  flag_motion_model,
double  s,
double  proba_handcrafted_0 
)

This function minimize by scanning on values.

Truncated gaussian at 4*sigma.

Definition at line 84 of file best_snapshot_average.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

best_snapshot_average_energy ( double  deltat,
int  flag_motion_model,
double  s,
double  proba_handcrafted_0 
)

Given a motion model compute the energy (noiseness on average of the restored taking the deconvolution into account). This fucntion computes : E()= E_v() (v) dv = {-}^{}{^2}{sin^2({ v }{2})} {v^2 }{4}(v) d dv. In other words using a snapshot with exposure time deltat and assuming a motion model will multiply the noise by a best_snapshot_average_energy(deltat, flag_motion_model, s) factor (on average on v).

Parameters:
doubledeltat : exposure time
intflag_motion_model : motion model selection -0 for truncated Gaussian of std-dev s; -1 For uniform of range s; -2 For replace distribution (s the probability of v=0).
doubles : motion model parameter
doubleproba_handcrafted_0 probability of v==0 hancrafted motion model only

Computes E() depending on (the motion model)

Initalization.

Main loop for evaluation of

When (v) is the handcrafted, compute the tegral as a mere sum (few non zero in the integral) (v)=proba_handcrafted_0*(v)+(1-proba_handcrafted_0)* (v) is the handcrafted, better to compute the integral as a mere sum.

Definition at line 143 of file best_snapshot_average.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

best_snapshot_average_integrand ( double  v,
double  deltat 
)

Given a motion model compute the energy (noiseness of the restored after deconvolution) In other words using a snapshot with exposure time deltat at velocity v will multiply the noise by a best_snapshot_average_integrand( v, deltat) factor on average (on ). This is the energy E_v()= {-}^{){4 ^2v^2}{sin^2({}{2})}d.

Parameters:
doubledeltat : exposure time
doublev : velocity.

Compute E_v()= {-}^{) {4 ^2v^2}{sin^2({}{2})}d Avoiding the computation on [-, 0] because the integrand is even.

Main loop for evaluation of

Definition at line 226 of file best_snapshot_average.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

best_snapshot_integrand ( double  xi,
double  v,
double  deltat 
)

Given a frequency, a velocity, an exposure time compute the noise multiplication factor In orther words using snaphot with exposure time of deltat at velocity v will multiply the noise of the frequency xi b y best_snapshot_integrand( xi, v, deltat):= {4 ^2 v^2 }{sin^2({ v }{2})}.

Parameters:
doublexi : frequency
doublev : velocity
doubledeltat : exposure time

Definition at line 283 of file best_snapshot_average.cpp.

Here is the caller graph for this function:

proba_motion_model ( double  v,
double  s,
double  proba_handcrafted_0,
int  flag_motion_model 
)

Given a motion model compute the probability of the velocity v ((v))

Parameters:
doublev : velocity
intflag_motion_model : motion model selection -0 for truncated Gaussian of std-dev s; -1 For uniform of range s; -2 For handcrafted distribution (s the probability of v=0).
doubles : motion model parameter
doubleproba_handcrafted_0 probability of v==0 hancrafted motion model only

Normalization is unnecessary; it'll lead to a constant multiplication

Only called with 0,1 or 2 if this line is reached the handscrafted distribution is selected.

Definition at line 324 of file best_snapshot_average.cpp.

Here is the caller graph for this function:

 All Files Functions Defines