Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de metrique dans AT et approche multiresolution. Noemie Tasca, … #344

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9dc2429
Ajout de metrique dans AT et approche multiresolution. Noemie Tasca, …
NoemieTasca Sep 4, 2018
9586be2
Nettoyage du code
NoemieTasca Sep 5, 2018
8dd87c5
refactor code
NoemieTasca Sep 10, 2018
0810108
fixed issues
NoemieTasca Sep 11, 2018
8cbd8b9
add images into image processing
NoemieTasca Sep 12, 2018
ab4a285
add images into image processing
NoemieTasca Sep 12, 2018
648c6da
add documentation doxygen
NoemieTasca Sep 12, 2018
e695aec
update doxygen documentation
NoemieTasca Sep 13, 2018
1a28088
update doxygen documentation
NoemieTasca Sep 13, 2018
97a453c
update doxygen documentation
NoemieTasca Sep 13, 2018
1b91fbd
update doxygen documentation of tool atu2v0-m
NoemieTasca Sep 13, 2018
c185282
update doxygen documentation of tool atu2v0-m
NoemieTasca Sep 13, 2018
3b6a7ad
update doxygen documentation of tool atu2v0-m
NoemieTasca Sep 13, 2018
2e68230
update doxygen documentation of main page
NoemieTasca Sep 13, 2018
573c608
fixed issues on at-u2-v0-m.cpp
NoemieTasca Sep 13, 2018
258b798
fixed issues on at-u2-v0-m.cpp
NoemieTasca Sep 13, 2018
13dd057
update doxygen documentation
NoemieTasca Sep 13, 2018
d99f052
Fix seg fault
JacquesOlivierLachaud Nov 26, 2018
d5ffd6f
Add images
JacquesOlivierLachaud Nov 26, 2018
20dde8c
Working version of ATm
JacquesOlivierLachaud Nov 26, 2018
3f9b2a6
Consolidating energy computations
JacquesOlivierLachaud Nov 26, 2018
7e13a6b
Consolidating energy computations
JacquesOlivierLachaud Nov 26, 2018
c7287f1
Update doc
JacquesOlivierLachaud Nov 26, 2018
7c512f6
Add image
JacquesOlivierLachaud Nov 27, 2018
f4ef390
Merge branch 'master' into Noemie
kerautret May 11, 2020
5c72fae
Merge branch 'master' into Noemie
kerautret May 13, 2020
3227d63
Update imageProcessing/at-u2-v0-m.cpp
JacquesOlivierLachaud Jun 2, 2020
dd1a9ff
Update imageProcessing/at-u2-v0-m.cpp
JacquesOlivierLachaud Jun 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/imageprocessing.dox
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,20 @@
</table>
</center>

- @ref DocATu2v0-m : Computes a piecewise smooth approximation of an image, by optimizing the Ambrosio-Tortorelli functional (with u a 2-form and v a 0-form) including metric.

<center>
<table>
<tr>
<td> @image html images/LenaBruit256.png height=200px </td>
<td> @image html images/LenaBruit256Restaure.png height=200px </td>
<td> @image html images/LenaBruit256Contours.png height=200px </td>
</tr>
<tr>
<td colspan=3 align = center>@ref DocATu2v0-m </td>
</tr>
</table>
</center>


*/
Binary file added doc/images/Degrade128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/DegradeBruit128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/DegradeBruit128Restaure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/DegradeBruit256Restaure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/LenaBruit256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/LenaBruit256Contours.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/LenaBruit256Restaure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/lena-256-b02-restaure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 97 additions & 1 deletion doc/moduleAT.dox
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Part of tool \ref imageProcessing.
[TOC]

- related tools: \ref DocATu2v0, \ref DocATu0v1
- related tools: \ref DocATu2v0, \ref DocATu0v1, \ref DocATu2v0-m
- related classes: \ref DGtal::ATu0v1, \ref DGtal::ATu2v0, \ref DGtal::DECImage2D
- related namespace: \ref DGtal::functions::dec
- related functions: \ref DGtal::functions::dec::diagonal, \ref DGtal::functions::dec::squares, \ref DGtal::functions::dec::squaredDiagonal, \ref DGtal::functions::dec::writePixel, \ref DGtal::functions::dec::writePrimalLinel, \ref DGtal::functions::dec::writeDualLinel, \ref DGtal::functions::dec::form2ToImage, \ref DGtal::functions::dec::form1ToImage, \ref DGtal::functions::dec::dualForm1ToImage, \ref DGtal::functions::dec::primalForm1ToImage, \ref DGtal::functions::dec::threeForms2ToImage, \ref DGtal::functions::dec::form2ToGreyLevelImage, \ref DGtal::functions::dec::primalForm1ToGreyLevelImage, \ref DGtal::functions::dec::dualForm1ToGreyLevelImage, \ref DGtal::functions::dec::primalForm1ToRGBColorImage, \ref DGtal::functions::dec::dualForm1ToRGBColorImage, \ref DGtal::functions::dec::threeForms2ToRGBColorImage.
Expand Down Expand Up @@ -426,6 +426,102 @@ triple points in the L2-metric sense.



<!-- Partie de Noemie ---------------------------------------------------------------------------------------------- -->

@section AT2m Discretization of AT with discrete calculus inluding euclidean metric


@subsection AT2m_1 Formulations AT20-m with metric

Let \f$ N \f$ be the size of image.
Let \f$ h \f$ be the step associated to the image resolution and defined as
\f[
\displaystyle
h = \frac{1}{N}
\f]

The euclidean metric appears in the scalar product
\f[
\displaystyle
\langle
a , b
\rangle
=
a^T \, G_k \, b
\f]
where \f$ G_k \f$ are diagonal matrices, called metric tensors of k-forms (for \f$ k \in 0,1,2 \f$) and defined as
\f[
\displaystyle
G_0 =
\begin{bmatrix}
h^2 & & \\
& \ddots & \\
& & h^2
\end{bmatrix}
\quad \quad
G_1 =
\begin{bmatrix}
\mathbf{1} & & \\
& \ddots & \\
& & \mathbf{1}
\end{bmatrix}
\quad \quad
G_2 =
\begin{bmatrix}
\dfrac{1}{h^2} & & \\
& \ddots & \\
& & \dfrac{1}{h^2}
\end{bmatrix}
\f]

Hence, the formulation of AT20-m including metric become
\f[
\displaystyle
\begin{array}{rcl}
AT_\varepsilon^{2,0} (u,v)
&=&
\alpha \, \sum_{i=1}^n \left( u_i - g_i \right)^T \, G_2 \, \left( u_i - g_i \right) \\[0.2cm]
&+&
\sum_{i=1}^n u_i^T \, G_2^T \, B'^T \, diag\left( M_{01} \, v \right)^2 \, B' \, G_2 \, u_i \\[0.2cm]
&+&
\lambda \, \varepsilon \, v^T \, A^T \, G_1 \, A \, v + \dfrac{\lambda}{4 \, \varepsilon} \, \left( 1 - v \right)^T \, G_0 \, \left( 1 - v \right)
\end{array}
\f]


@subsection AT2m_2 Solutions to AT20-m

Functional AT20-m is sum of quadratic terms, independently,
but not simultaneously, convex in \f$ u \f$ and \f$ v \f$.
It must has null derivative at optimum.
We thus propose to alternatively solve for \f$ u \f$, then \f$ v \f$.
The derivatives can be given explicitly as linear systems.
To simplify notations, let \f$ \mathbf{A} := \mathbf{d_0} \f$,
\f$ \mathbf{B} := \mathbf{d_1} \f$,
\f$ \mathbf{A'} := \bar{\mathbf{\star}} \bar{\mathbf{d_1}} \mathbf{\star} \f$
and \f$ \mathbf{B'} := \bar{\mathbf{\star}} \bar{\mathbf{d_0}} \mathbf{\star} \f$.
We get at optimum:

\f[
\displaystyle
\left\{
\begin{array}{rcl}
\left[ \alpha \, G_2 \, + \, G_2^T \, B'^T \, diag\left( M_{01} v \right)^2 \, B' \, G_2 \right] u_i
& = &
\alpha \, G_2 \, g_i \\
\left[ \dfrac{\lambda}{4 \, \varepsilon} \, G_0 \, + \, \lambda \, \varepsilon \, A^T \, G_1 \, A \, + \, M_{01} \, \left( diag\left( B' \, G_2 \, u_i \right)^2 \right)^T \, M_{01} \right] v
& = &
\dfrac{\lambda}{4 \, \varepsilon} \, G_0 \, \mathbf{1}
\end{array}
\right.
\f]

Since all matrices are symmetric, definite and positive, we use a Cholesky factorization to
solve alternatively the two equations of each system.

<!-- Partie de Noemie ---------------------------------------------------------------------------------------------- -->



@section References

Expand Down
Loading