Merge branch 'bordel_laurent' of git.inpt.fr:tocard-inc/enseeiht/projet-be into bordel_laurent

This commit is contained in:
gdamms 2023-01-30 10:26:45 +01:00
commit 9e41de60ad
7 changed files with 1416 additions and 16 deletions

Binary file not shown.

BIN
docs/figs/fvi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
docs/figs/lvl7_2D.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

BIN
docs/figs/lvl7_3D.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 MiB

View file

@ -2,8 +2,7 @@
theme: academic theme: academic
class: text-white class: text-white
coverAuthor: Laurent Fainsin, Damien Guillotin, Pierre-Eliot Jourdan coverAuthor: Laurent Fainsin, Damien Guillotin, Pierre-Eliot Jourdan
coverBackgroundUrl: >- coverBackgroundUrl: https://images.unsplash.com/photo-1655720408861-8b04c0724fd9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8
https://images.unsplash.com/photo-1655720408861-8b04c0724fd9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8
coverBackgroundSource: unplash coverBackgroundSource: unplash
coverBackgroundSourceUrl: https://unsplash.com/photos/Vc0CmuIfMg0 coverBackgroundSourceUrl: https://unsplash.com/photos/Vc0CmuIfMg0
coverDate: '2023-01-05' coverDate: '2023-01-05'
@ -25,14 +24,85 @@ Sujet 6 - Reformulation du MVS par level sets
<img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Level_set_method.png" class="m-auto -mt-7"/> <img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Level_set_method.png" class="m-auto -mt-7"/>
<style>
span.katex {
position: absolute;
top: 48%;
}
</style>
$\mathcal{V}_t = \{ \textbf{Q} \in \mathbb{R}^3, u(\textbf{Q}) = t \}, \quad t\in [0,1], \quad u \colon \mathbb{R}^3 \to [0, 1]$
<a href="https://en.wikipedia.org/wiki/Level-set_method" class="absolute bottom-0 font-extralight mb-1 mr-2 right-0 text-xs">Wikipedia</a>
--- ---
## Exemple Level sets 2D ## Exemple Level sets 2D
<img src="figs/lvl7_2D.gif" class="m-auto mt-5"/>
---
## Exemple Level sets 3D
<img src="figs/lvl7_3D.gif" class="m-auto -mt-1 h-125"/>
---
## Approximation du volume
<img src="figs/lvl7_2D.png" class="m-auto h-110"/> <img src="figs/lvl7_2D.png" class="m-auto h-110"/>
<Footnotes separator> <span class="absolute bottom-0 font-extralight mb-1 mr-2 right-0 text-xs">Variational principles, surface evolution, PDEs, level set methods, and the stereo problem - Olivier Faugeras, Renaud Keriven, 1998</span>
<Footnote>
Variational principles, surface evolution, PDEs, level set methods, and the stereo problem - Olivier Faugeras, Renaud Keriven, 1998 ---
</Footnote>
</Footnotes> ## Discrétisation de l'espace
<img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/Voxels.svg" class="m-auto h-110">
<a href="https://en.wikipedia.org/wiki/Voxel" class="absolute bottom-0 font-extralight mb-1 mr-2 right-0 text-xs">Wikipedia</a>
---
## Mise à jour du volume
consensus blabla
---
## Initialisation du volume
ones ou alors shape from silouhette
---
## Exemple Shape from Silouhette
---
## Raytracing
<img src="https://cdn.discordapp.com/attachments/953586522572066826/1068141883810914427/fvi2.png" class="m-auto -mt-10 h-125"/>
---
## Raytracing
<img src="https://cdn.discordapp.com/attachments/953586522572066826/1068141884242931712/fvi4.png" class="m-auto -mt-10 h-125"/>
---
## Raytracing
<img src="https://cdn.discordapp.com/attachments/953586522572066826/1068141884679147602/fvi6.png" class="m-auto -mt-10 h-125"/>
---
## Raytracing
<img src="https://cdn.discordapp.com/attachments/953586522572066826/1068141885056622661/fvi8.png" class="m-auto -mt-10 h-125"/>
---
## Résultats

View file

@ -1,9 +1,9 @@
import imageio.v2 as imageio
import matplotlib.pyplot as plt
import mcubes import mcubes
import numpy as np import numpy as np
import matplotlib.pyplot as plt
import imageio.v2 as imageio
import perlin_noise import perlin_noise
from rich.progress import track
def generate_perlin_noise_3d(shape, res): def generate_perlin_noise_3d(shape, res):
def f(t): def f(t):
@ -79,20 +79,24 @@ V = np.array(V)
V = (V - V.min()) / (V.max() - V.min()) V = (V - V.min()) / (V.max() - V.min())
frame_list = [] frame_list = []
for i in np.linspace(0.05, 0.55, 100): for i in track(np.linspace(0.05, 0.55, 100)):
plt.clf() plt.clf()
plt.subplot(1, 2, 1) plt.subplot(1, 2, 1)
plt.imshow(V, cmap="gray") plt.imshow(V, cmap="gray")
plt.contour(V, [i], colors="r") plt.contour(V, [i], colors="r")
plt.plot([0, 0, 100, 100, 0], [0, 100, 100, 0, 0], "k-") plt.plot([0, 0, 100, 100, 0], [0, 100, 100, 0, 0], "k-")
plt.axis('off') plt.xlim(0, 100)
plt.ylim(0, 100)
plt.axis("off")
plt.subplot(1, 2, 2) plt.subplot(1, 2, 2)
plt.imshow(V > i, cmap="gray") plt.imshow(V > i, cmap="gray")
plt.plot([0, 0, 100, 100, 0], [0, 100, 100, 0, 0], "k-") plt.plot([0, 0, 100, 100, 0], [0, 100, 100, 0, 0], "k-")
plt.axis('off') plt.xlim(0, 100)
plt.ylim(0, 100)
plt.axis("off")
plt.savefig(f"/tmp/frame.png") plt.savefig(f"/tmp/frame.png", dpi=300, bbox_inches="tight", pad_inches=0, transparent=True)
frame_list.append(imageio.imread(f"/tmp/frame.png")) frame_list.append(imageio.imread(f"/tmp/frame.png"))
imageio.mimsave('picture.gif', frame_list + frame_list[::-1], fps=60) imageio.mimsave("docs/figs/lvl7.gif", frame_list + frame_list[::-1], fps=60)

1326
tmp.py Normal file

File diff suppressed because it is too large Load diff