You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: meshroom/aliceVision/SfMPoseInjecting.py
+70-1Lines changed: 70 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,67 @@ class SfMPoseInjecting(desc.AVCommandLineNode):
11
11
size=desc.DynamicNodeSize("input")
12
12
13
13
category="Utils"
14
-
documentation="""Use a JSON file to inject poses inside the SfMData."""
14
+
documentation="""
15
+
Use a JSON file to inject poses inside the SfMData.
16
+
17
+
[
18
+
{
19
+
'frame_no': 45,
20
+
'rx': 1.2,
21
+
'ry': -0.3,
22
+
'rz': 0.1
23
+
'tx': 5,
24
+
'ty': 6,
25
+
'tz': -2
26
+
}
27
+
]
28
+
29
+
or
30
+
31
+
[
32
+
{
33
+
'path': "image_filename",
34
+
'rx': 1.2,
35
+
'ry': -0.3,
36
+
'rz': 0.1
37
+
'tx': 5,
38
+
'ty': 6,
39
+
'tz': -2
40
+
}
41
+
]
42
+
43
+
or
44
+
45
+
[
46
+
{
47
+
'path': "/path/to/image",
48
+
'rx': 1.2,
49
+
'ry': -0.3,
50
+
'rz': 0.1
51
+
'tx': 5,
52
+
'ty': 6,
53
+
'tz': -2
54
+
}
55
+
]
56
+
57
+
58
+
frame_no is the detected frameId which is set by the number found in the image filename.
59
+
60
+
Let's say you have a point with coordinates in the *camera frame*. The coordinates in the common world frame are given by the rotation matrix world_R_camera and the translation vector world_t_camera such that
world_t_camera is defined by the triplet [tx, ty, tz] in the json file
65
+
world_R_camera is defined by the triplet [rx, ry, rz] (in degrees) in the json file.
66
+
67
+
The matrix world_R_camera is built from the triplet, transformed using a function R depending on rotationFormat.
68
+
69
+
If rotationFormat is EulerZXY, then world_R_camera = R_y(ry) * R_x(rx) * R_z(rz)
70
+
Where R_x(rx) is the rotation along the x axis of rx degrees, R_y(ry) is the rotation along the y axis of ry degrees, R_z(rz) is the rotation along the z axis of rz degrees. It is the ZXY euler representation.
71
+
72
+
Meshroom assumes that the axis x, y and z of the geometric frame in which you define the rotation and the translation is in Right hand coordinates where X points to the right, Y points downward, and Z points away from the camera. But you can change this using geometricFrame.
73
+
74
+
"""
15
75
16
76
inputs= [
17
77
desc.File(
@@ -34,6 +94,15 @@ class SfMPoseInjecting(desc.AVCommandLineNode):
34
94
values=["EulerZXY"],
35
95
value="EulerZXY",
36
96
),
97
+
desc.ChoiceParam(
98
+
name="geometricFrame",
99
+
label="Geometric Frame",
100
+
description="Defines the geometric frame for the input poses:\n"
101
+
" - RHXrYbZf : Right hand coordinates, X right, Y down, Z far"
102
+
" - RHXrYtZb : Right hand coordinates, X right, Y up, Z behind",
0 commit comments