2/3 modifs des slides
This commit is contained in:
parent
4b203cafc2
commit
8b8c43d363
BIN
docs/figs/lvl7_2D.png
Normal file
BIN
docs/figs/lvl7_2D.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 207 KiB |
|
@ -20,3 +20,19 @@ title: Bureau d'étude de PI3D
|
|||
Sujet 6 - Reformulation du MVS par level sets
|
||||
|
||||
---
|
||||
|
||||
## Level sets ?
|
||||
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Level_set_method.png" class="m-auto -mt-7"/>
|
||||
|
||||
---
|
||||
|
||||
## Exemple Level sets 2D
|
||||
|
||||
<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>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import bpy
|
||||
import math
|
||||
import itertools
|
||||
import math
|
||||
import pathlib
|
||||
import pickle
|
||||
import sys
|
||||
|
||||
import bpy
|
||||
import numpy as np
|
||||
|
||||
# dirty hack to import proj.py
|
||||
|
@ -17,15 +18,15 @@ from proj import get_3x4_P_matrix_from_blender
|
|||
EXPORT_PATH = pathlib.Path("/tmp/")
|
||||
|
||||
# setup camera poses
|
||||
phis = [-45, 0, 45]
|
||||
thetas = [0, 45, 90, 135, 180, 225, 270, 315]
|
||||
rotsY = range(-45, 45 + 1, 20)
|
||||
rotsZ = range(-45, 45 + 1, 20)
|
||||
|
||||
# convert to radians
|
||||
phis = [math.radians(phi) for phi in phis]
|
||||
thetas = [math.radians(theta) for theta in thetas]
|
||||
rotsY = [math.radians(rotY) for rotY in rotsY]
|
||||
rotsZ = [math.radians(rotZ) for rotZ in rotsZ]
|
||||
|
||||
# create all possible combinations
|
||||
poses = list(itertools.product(phis, thetas))
|
||||
poses = list(itertools.product(rotsY, rotsZ))
|
||||
|
||||
# create export folders
|
||||
pathlib.Path(EXPORT_PATH / "images").mkdir(parents=True, exist_ok=True)
|
||||
|
@ -39,12 +40,12 @@ bpy.data.scenes["Scene"].node_tree.nodes["Mask Output"].base_path = str(EXPORT_P
|
|||
# get camera
|
||||
cam = bpy.data.objects["Camera"]
|
||||
|
||||
for i, (phi, theta) in enumerate(poses):
|
||||
for i, (rotY, rotZ) in enumerate(poses):
|
||||
print(f"Rendering pose {i}...")
|
||||
|
||||
# set camera pose
|
||||
bpy.context.scene.objects["Empty"].rotation_euler[0] = phi
|
||||
bpy.context.scene.objects["Empty"].rotation_euler[2] = theta
|
||||
bpy.context.scene.objects["Empty"].rotation_euler[1] = rotY
|
||||
bpy.context.scene.objects["Empty"].rotation_euler[2] = rotZ
|
||||
|
||||
# fuck you blender and your stupid shit
|
||||
bpy.context.view_layer.update()
|
||||
|
|
Loading…
Reference in a new issue