The flutter shutter camera simulator
Defines | Functions
flutter.cpp File Reference

Routines for Flutter-Shutter simulation. This file contains functions that are usefull for both kinds of flutter shutter camera (numerical or analog) The kernel definition, the deconvolution, and a renormalization function. More...

#include <stdlib.h>
#include <time.h>
#include <math.h>
#include "codes_flutter.cpp"
#include "flutter.h"
#include "fftw_routines.h"
#include "borders.h"
#include "mt19937ar.h"
Include dependency graph for flutter.cpp:

Go to the source code of this file.

Defines

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

Functions

void flutter_kernel (double *kernel_real, double *kernel_imag, int code_number, int width, int height, float velocity, float deltat)
void flutter_restore (double *acquired, int code_number, int width, int height, float velocity, double *restored, int border_size, float deltat)
float integral_code (int code_number, float deltat)
void flutter_kernel_k (double *kernel_real, double *kernel_imag, int k, int width, int height, float velocity, float deltat)
void add_poisson_noise (double *image, int width, int height, float snr)
void flutter_numerical (double *acquired, int code_number, int width, int height, float velocity, float deltat, float snr)
 Given a code it simulates a numerical flutter shutter.
void flutter_analog (double *acquired, int code_number, int width, int height, float velocity, float deltat, float snr)

Detailed Description

Routines for Flutter-Shutter simulation. This file contains functions that are usefull for both kinds of flutter shutter camera (numerical or analog) The kernel definition, the deconvolution, and a renormalization function.

Author:
Yohann Tendero <yohann.tendero@cmla.ens-cachan.fr>

Definition in file flutter.cpp.


Define Documentation

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

Definition at line 46 of file flutter.cpp.

#define eps   0.000001

Definition at line 47 of file flutter.cpp.

#define M_PI   3.14159265358979323846

M_PI is a POSIX definition for Pi

Definition at line 43 of file flutter.cpp.

#define POS (   x)    (((x) > 0) ? (x) : (0))

Definition at line 48 of file flutter.cpp.


Function Documentation

void add_poisson_noise ( double *  image,
int  width,
int  height,
float  snr 
)

contains the intensity lambda= u (k)

Small intensity (after renormalization)

Bigger intensity : approximation by a Gaussian

Definition at line 384 of file flutter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void flutter_analog ( double *  acquired,
int  code_number,
int  width,
int  height,
float  velocity,
float  deltat,
float  snr 
)

Allocating DFT of input

FFT FORWARD IMAGE

COMPUTING THE FT OF THE CODE allocating, init

actual computation

CONVOLUTION

NOISE

Definition at line 587 of file flutter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void flutter_kernel ( double *  kernel_real,
double *  kernel_imag,
int  code_number,
int  width,
int  height,
float  velocity,
float  deltat 
)

The kernel is k()=2 deltat {sin({ v deltat} 2 }{ v deltat} {k=0}^{N-1} exp(-i v deltat {2k+1}{2} [-,], (constant among lines).

Definition at line 75 of file flutter.cpp.

Here is the caller graph for this function:

void flutter_kernel_k ( double *  kernel_real,
double *  kernel_imag,
int  k,
int  width,
int  height,
float  velocity,
float  deltat 
)

The kth kernel is k()=2 deltat {sin({ v deltat} 2 }{ v deltat} exp(-i v deltat {2k+1}{2} [-,]

Definition at line 298 of file flutter.cpp.

Here is the caller graph for this function:

void flutter_numerical ( double *  acquired,
int  code_number,
int  width,
int  height,
float  velocity,
float  deltat,
float  snr 
)

Given a code it simulates a numerical flutter shutter.

void flutter_numerical(float *Image,int code_number,int width, int height, float velocity, float deltat, float *acquired, float snr)

Parameters:
*Image: image used for simulation
code_number: : index of the code in the list
widthof *Image
heightof *Image
velocity: relative velocity between the camera and the landscape
deltat: temporal sampling.
*acquired: impage observed
snr: noise level.

Allocating DFT of input

FFT FORWARD IMAGE

COMPUTING THE FT OF THE CODE allocating, init

Definition at line 452 of file flutter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void flutter_restore ( double *  acquired,
int  code_number,
int  width,
int  height,
float  velocity,
double *  restored,
int  border_size,
float  deltat 
)

Remark : not computing the Kernel one and for all because the size change (crop).

Classic Mirror symmetryzation

Allocating DFT of input for deconvolution and compute the DFT of image

Allocating DFT of input for deconvolution and compute the DFT of the kernel

DECONVOLUTION

Definition at line 187 of file flutter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float integral_code ( int  code_number,
float  deltat 
)

Definition at line 257 of file flutter.cpp.

Here is the caller graph for this function:

 All Files Functions Variables Typedefs Defines