The flutter shutter camera simulator
|
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"
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) |
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.
Definition in file flutter.cpp.
#define ABS | ( | x | ) | (((x) > 0) ? (x) : (-(x))) |
Definition at line 49 of file flutter.cpp.
#define eps 0.000001 |
Definition at line 50 of file flutter.cpp.
#define M_PI 3.14159265358979323846 |
M_PI is a POSIX definition for Pi
Definition at line 46 of file flutter.cpp.
#define POS | ( | x | ) | (((x) > 0) ? (x) : (0)) |
Definition at line 51 of file flutter.cpp.
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 400 of file flutter.cpp.
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 603 of file flutter.cpp.
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} [-,]
Inverse human Reshapping Avoid multiple reshape
Definition at line 78 of file flutter.cpp.
void flutter_kernel_k | ( | double * | kernel_real, |
double * | kernel_imag, | ||
int | k, | ||
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} [-,]
Inverse human Reshapping Avoid multiple reshape
Definition at line 301 of file flutter.cpp.
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)
*Image | : image used for simulation |
code_number | : : index of the code in the list |
width | of *Image |
height | of *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 468 of file flutter.cpp.
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 190 of file flutter.cpp.
float integral_code | ( | int | code_number, |
float | deltat | ||
) |