Merge branch 'bordel_laurent' of git.inpt.fr:tocard-inc/enseeiht/projet-be into bordel_laurent
This commit is contained in:
commit
9e41de60ad
BIN
cuby.blend
BIN
cuby.blend
Binary file not shown.
BIN
docs/figs/fvi.png
Normal file
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
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
BIN
docs/figs/lvl7_3D.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 32 MiB |
|
@ -2,8 +2,7 @@
|
|||
theme: academic
|
||||
class: text-white
|
||||
coverAuthor: Laurent Fainsin, Damien Guillotin, Pierre-Eliot Jourdan
|
||||
coverBackgroundUrl: >-
|
||||
https://images.unsplash.com/photo-1655720408861-8b04c0724fd9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8
|
||||
coverBackgroundUrl: https://images.unsplash.com/photo-1655720408861-8b04c0724fd9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8
|
||||
coverBackgroundSource: unplash
|
||||
coverBackgroundSourceUrl: https://unsplash.com/photos/Vc0CmuIfMg0
|
||||
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"/>
|
||||
|
||||
<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
|
||||
|
||||
<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"/>
|
||||
|
||||
<Footnotes separator>
|
||||
<Footnote>
|
||||
Variational principles, surface evolution, PDEs, level set methods, and the stereo problem - Olivier Faugeras, Renaud Keriven, 1998
|
||||
</Footnote>
|
||||
</Footnotes>
|
||||
<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>
|
||||
|
||||
---
|
||||
|
||||
## 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
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import imageio.v2 as imageio
|
||||
import matplotlib.pyplot as plt
|
||||
import mcubes
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import imageio.v2 as imageio
|
||||
import perlin_noise
|
||||
|
||||
from rich.progress import track
|
||||
|
||||
def generate_perlin_noise_3d(shape, res):
|
||||
def f(t):
|
||||
|
@ -74,25 +74,29 @@ imageio.mimsave('picture.gif', frame_list + frame_list[::-1], fps=60)
|
|||
noise = perlin_noise.PerlinNoise(octaves=6, seed=1)
|
||||
|
||||
X, Y = np.mgrid[:100, :100]
|
||||
V = [[10 * noise([x/100, y/100]) + np.sqrt((x-50)**2 + (y-50)**2) for y in range(100)] for x in range(100)]
|
||||
V = [[10 * noise([x / 100, y / 100]) + np.sqrt((x - 50) ** 2 + (y - 50) ** 2) for y in range(100)] for x in range(100)]
|
||||
V = np.array(V)
|
||||
V = (V - V.min()) / (V.max() - V.min())
|
||||
|
||||
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.subplot(1, 2, 1)
|
||||
plt.imshow(V, cmap="gray")
|
||||
plt.contour(V, [i], colors="r")
|
||||
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.imshow(V > i, cmap="gray")
|
||||
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"))
|
||||
|
||||
imageio.mimsave('picture.gif', frame_list + frame_list[::-1], fps=60)
|
||||
imageio.mimsave("docs/figs/lvl7.gif", frame_list + frame_list[::-1], fps=60)
|
||||
|
|
Loading…
Reference in a new issue