Non-uniformity correction of infrared images by midway equalization
Defines | Functions
MIRE.cpp File Reference

Routines using MIRE. More...

#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
#include <cmath>
#include "MIRE.h"
Include dependency graph for MIRE.cpp:

Go to the source code of this file.

Defines

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

Functions

void MIRE_automatic (float *IMAGE, int w1, int h1, int SIGMA_MIN, int SIGMA_MAX, float DELTA)
 Compute the TV of MIRE-processed image for a set of parameter sigma namely (SIGMA_MIN:DELTA:SIGMA_MAX). Keep the one that minimizing the TV criterion and sent it back to the main.
float * MIRE (float *IMAGE, float sigma, int w1, int h1)
 Performs the MIRE algorithm with parameter sigma.
float TV_column_norm (float *IMAGE, int w1, int h1, float B)
 Compute TV-norm among colums (avoids the parts added by symetrization).
float gaussian (int x, float sigma)
 Evaluate the Gaussian function at x with std-dev sigma.
void specify_column (float *IMAGE, int w1, int h1, int column_current, std::vector< float > target_values)
 Given the vector containing the target value. Specify he column on theses values Implemented in 2 steps: Step1: sort v_column put it in column_sorted Step2: for each entry v_column(i) find indice j of column_sorted such that column_sorted(j)==v_column(i) change v_column(j) to v_column(j)=target_values(j)
std::vector< std::vector< float > > target_histogram (std::vector< std::vector< float > > V_HISTOS, int w1, int h1, float sigma)
 Compute the target vector (~ histogram) Implemented in 3 steps: Step1 : extract columns columns in the interval ["column"-4sigma, "column"+4sigma] Step2 : Sort all vectors obtained from step1 separately Step3 : for all lines and all column of step2 compute the midway gaussian averaged ie : v(i)=WEIGHT(column).*(paquet(ligne,column)));.
std::vector< float > histo_column (float *IMAGE, int w1, int h1, int column)
 Take the column N°column, put it in a vertor and sort it.
std::vector< std::vector< float > > column_sorting (float *IMAGE, int w1, int h1)
 Sort all columns of the image.

Detailed Description

Routines using MIRE.

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

Definition in file MIRE.cpp.


Define Documentation

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

Definition at line 35 of file MIRE.cpp.

#define M_PI   3.14159265358979323846

M_PI is a POSIX definition for Pi

Definition at line 41 of file MIRE.cpp.


Function Documentation

std::vector< std::vector< float > > column_sorting ( float *  IMAGE,
int  w1,
int  h1 
)

Sort all columns of the image.

Parameters:
IMAGEinput
w1image width
h1image height
Returns:
V_HISTOS

Definition at line 409 of file MIRE.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float gaussian ( int  x,
float  sigma 
)

Evaluate the Gaussian function at x with std-dev sigma.

Arguements : imge, image size, column to be processed, target values.

Parameters:
xpoint of evaluation
sigmastd-dev of the gaussian
Returns:
1/(sigma*sqrt(2*M_PI))*exp(-(x*x)/(2*sigma*sigma))

Definition at line 219 of file MIRE.cpp.

Here is the caller graph for this function:

std::vector< float > histo_column ( float *  IMAGE,
int  w1,
int  h1,
int  column 
)

Take the column N°column, put it in a vertor and sort it.

Parameters:
IMAGEinput
w1image width
h1image height
columnindex of the column
Returns:
v

compute the histogram of the column "column" (v contains sorted columns )

Definition at line 385 of file MIRE.cpp.

Here is the caller graph for this function:

float * MIRE ( float *  IMAGE,
float  sigma,
int  w1,
int  h1 
)

Performs the MIRE algorithm with parameter sigma.

Parameters:
IMAGEinput
sigma
w1image width
h1image height
Returns:
IMAGE

Arguments : image, std-dev of gaussian, image size. output image processed with sdt-dev equal to sigma

Definition at line 150 of file MIRE.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void MIRE_automatic ( float *  IMAGE,
int  w1,
int  h1,
int  SIGMA_MIN,
int  SIGMA_MAX,
float  DELTA 
)

Compute the TV of MIRE-processed image for a set of parameter sigma namely (SIGMA_MIN:DELTA:SIGMA_MAX). Keep the one that minimizing the TV criterion and sent it back to the main.

Parameters:
IMAGEinput
w1image width
h1image height
SIGMA_MIN
SIGMA_MAX
DELTA: step between two sigmas

Arguments : image, image size, SIGMA_MIN, SIGMA_MAX, DELTA : step between two sigmas The function guess the optimal sigma "sigma_best "and applies a MIRE with "sigma_best"

Definition at line 61 of file MIRE.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void specify_column ( float *  IMAGE,
int  w1,
int  h1,
int  column_current,
std::vector< float >  target_values 
)

Given the vector containing the target value. Specify he column on theses values Implemented in 2 steps: Step1: sort v_column put it in column_sorted Step2: for each entry v_column(i) find indice j of column_sorted such that column_sorted(j)==v_column(i) change v_column(j) to v_column(j)=target_values(j)

Parameters:
IMAGEinput
w1image width
h1image height
column_currentthe index of the column to process
target_valuesvector containing the values to apply

given a column (vector) of the image (v_column) an a vector containing target values (target_values) change the values of the image such that the min (c_i):=target_values(0), the next value of c_i changes to target_values(1) and so on Implemented in 2 steps: Step1: sort v_column put it in column_sorted Step2: for each entry v_column(i) find indice j of column_sorted such that column_sorted(j)==v_column(i) change v_column(j) to v_column(j)=target_values(j)

Definition at line 246 of file MIRE.cpp.

Here is the caller graph for this function:

std::vector< std::vector< float > > target_histogram ( std::vector< std::vector< float > >  V_HISTOS,
int  w1,
int  h1,
float  sigma 
)

Compute the target vector (~ histogram) Implemented in 3 steps: Step1 : extract columns columns in the interval ["column"-4sigma, "column"+4sigma] Step2 : Sort all vectors obtained from step1 separately Step3 : for all lines and all column of step2 compute the midway gaussian averaged ie : v(i)=WEIGHT(column).*(paquet(ligne,column)));.

Arguements : position (in pixel), std-dev.

Parameters:
V_HISTOSvector containing sorted columns.
w1image width
h1image height
sigmastd-dev of the Gaussian.
Returns:
FINAL

Compute the midway Gaussian averaged histogram. Gaussian weighted, troncated with radius equal to 4 sigma: only the columns in the interval ["column"-4sigma, "column"+4sigma] are taken into account. Input: image, column current, std-dev sigma Output : Midway-gaussian-averaged histogram (vector).

Implemented in 3 steps: Step1 : extract columns columns in the interval ["column"-4sigma, "column"+4sigma] Step2 : Sort all vectors obtained from step1 separately Step3 : for all lines and all column of step2 compute the midway gaussian averaged ie : v(i)=WEIGHT(column).*(paquet(ligne,column)));

Definition at line 316 of file MIRE.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float TV_column_norm ( float *  IMAGE,
int  w1,
int  h1,
float  B 
)

Compute TV-norm among colums (avoids the parts added by symetrization).

Parameters:
IMAGE: input
w1image width
h1image height
Bnumber of columns added by symetrization.
Returns:
TV

Arguments : image, width, length, B: number of columns added by symetrization. Computing the TV-norm among columns avoiding the parts added by symetrization.

Definition at line 189 of file MIRE.cpp.

Here is the caller graph for this function:

 All Files Functions Defines