- LO09
Y. Li and S. Osher. A new median formula with applications to pde based denoising. Commun. Math, 7:741–753, 2009.
- SRB10
D. Sun, S. Roth, and M. J. Black. Secrets of optical flow estimation and their principles. IEEE computer society conference on computer vision and pattern recognition., 17:2432–2439, 2010.
A. Src
Is a folder containaing the main python software sources.
Utilsimports the required functions and modules to run the code. The GPU version of the software will be privileged.If Utils find some missing functions or modules the CPU version will be launched.
Is used to compute the matrix-vector product of the inverse of the chosen preconditioner and a given vector.
This function will be used to create a matrix-free solver.
- Solveur precond:
It’s a matrix-free implementation of Minres solver used in scipy.sparse and the function Minres of Matlab. This function is adapted to solve the following problem
\[P^{-1}Ax=P^{-1}b\]Where \(A\) is the optical flow matrix, \(b\) the right hand term and \(P\) is the chosen preconditioner already defined in Precond file.
If we are handling \(N \times M\) images, then the problem has \(2\times N \times M\) as size.
The file contains also a function that computes the matrix-product of matrix of the problem and a given vector.
- Flow operator:
The role of
flow_operatormodule is the interpolation of the images using the current computed flow fields, the construction of the right hand term of the linear system and the definition of the base function for computing flow field that will be used at each level of the pyramid.- Compute flow:
Computes the optical flow fields using a pyramidal approach and the base function already defined in
flow_operator.- Energies:
For computing the different energies described in the paper of D.Sun[.
- Denoise LOnp:
Li and Osher [LO09] median filter implementation.
B. Test
To test the method we created a script able to read and modify the parameters of the algorithm using the sys.argv arguments.
To run the script you can use ./mainscript, then you have to add at least three arguments:
Path of the images folder
Name of the first image of the sequence
Name of the second image of the sequence
Syntax:
./mainscript /Give/The/Path/Folder Im1.extension Im2.extension
To change the value of a desired parameter, you must add it after the executable using it’s key :
Parameter |
Keyword |
Initial default value |
|---|---|---|
Number of levels in the pyramid |
pyram_levels |
3 |
The downsampling factor |
factor |
2 |
The order of interpolation [Must be between 0 and 5] |
ordre_inter |
3 |
|
size_median_filter |
5 |
Number of warping steps |
max_iter |
10 |
Maximum number of linearization performed per warping |
max_linear_iter |
1 |
Tikhonov Parameter |
lmbda |
3*10^4 |
Weight for coupling term |
lambda2 |
0.001 |
Weight for non local term |
lambda3 |
1 |
The name of the image Mask |
Mask |
None |
Path for the mask image |
Path_Mask |
— |
Syntax :
./mainscript /Give/The/Path/Folder Im1.extension Im2.extension keyword=new_value
Mask=Mask.extension Path_Mask=/Path/Folder/OfMask
C. Images
In order to test the software, three image sequences and some masks with different shapes were given in this folder.