Non-uniformity correction of infrared images by midway equalization
|
Routines using MIRE. More...
#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
#include <cmath>
#include "MIRE.h"
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. |
Routines using MIRE.
Definition in file MIRE.cpp.
#define M_PI 3.14159265358979323846 |
std::vector< std::vector< float > > column_sorting | ( | float * | IMAGE, |
int | w1, | ||
int | h1 | ||
) |
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.
x | point of evaluation |
sigma | std-dev of the gaussian |
Definition at line 219 of file MIRE.cpp.
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.
IMAGE | input |
w1 | image width |
h1 | image height |
column | index of the column |
compute the histogram of the column "column" (v contains sorted columns )
Definition at line 385 of file MIRE.cpp.
float * MIRE | ( | float * | IMAGE, |
float | sigma, | ||
int | w1, | ||
int | h1 | ||
) |
Performs the MIRE algorithm with parameter sigma.
IMAGE | input |
sigma | |
w1 | image width |
h1 | image height |
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.
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.
IMAGE | input |
w1 | image width |
h1 | image 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.
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)
IMAGE | input |
w1 | image width |
h1 | image height |
column_current | the index of the column to process |
target_values | vector 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.
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.
V_HISTOS | vector containing sorted columns. |
w1 | image width |
h1 | image height |
sigma | std-dev of the Gaussian. |
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.
float TV_column_norm | ( | float * | IMAGE, |
int | w1, | ||
int | h1, | ||
float | B | ||
) |
Compute TV-norm among colums (avoids the parts added by symetrization).
IMAGE | : input |
w1 | image width |
h1 | image height |
B | number of columns added by symetrization. |
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.