Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 0 additions & 44 deletions meshroom/aliceVision/ImportKnownPoses.py

This file was deleted.

67 changes: 67 additions & 0 deletions meshroom/aliceVision/SfMPoseInjecting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,64 @@ class SfMPoseInjecting(desc.AVCommandLineNode):
category = "Utils"
documentation = """
Use a JSON file to inject poses inside the SfMData.

[
{
'frame_no': 45,
'rx': 1.2,
'ry': -0.3,
'rz': 0.1
'tx': 5,
'ty': 6,
'tz': -2
}
]

or

[
{
'path': "image_filename",
'rx': 1.2,
'ry': -0.3,
'rz': 0.1
'tx': 5,
'ty': 6,
'tz': -2
}
]

or

[
{
'path': "/path/to/image",
'rx': 1.2,
'ry': -0.3,
'rz': 0.1
'tx': 5,
'ty': 6,
'tz': -2
}
]


frame_no is the detected frameId which is set by the number found in the image filename.

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

worldFramePoint = world_R_camera * cameraFramePoint + world_t_camera

world_t_camera is defined by the triplet [tx, ty, tz] in the json file
world_R_camera is defined by the triplet [rx, ry, rz] (in degrees) in the json file.

The matrix world_R_camera is built from the triplet, transformed using a function R depending on rotationFormat.

If rotationFormat is EulerZXY, then world_R_camera = R_y(ry) * R_x(rx) * R_z(rz)
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.

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.

"""

inputs = [
Expand All @@ -36,6 +94,15 @@ class SfMPoseInjecting(desc.AVCommandLineNode):
values=["EulerZXY"],
value="EulerZXY",
),
desc.ChoiceParam(
name="geometricFrame",
label="Geometric Frame",
description="Defines the geometric frame for the input poses:\n"
" - RHXrYbZf : Right hand coordinates, X right, Y down, Z far"
" - RHXrYtZb : Right hand coordinates, X right, Y up, Z behind",
values=["RHXrYbZf", "RHXrYtZb"],
value="RHXrYbZf",
),
desc.ChoiceParam(
name="verboseLevel",
label="Verbose Level",
Expand Down
13 changes: 0 additions & 13 deletions src/software/convert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ if (ALICEVISION_BUILD_SFM)
Boost::system
)

alicevision_add_software(aliceVision_importKnownPoses
SOURCE main_importKnownPoses.cpp
FOLDER ${FOLDER_SOFTWARE_CONVERT}
LINKS aliceVision_localization
aliceVision_feature
aliceVision_sfmData
aliceVision_sfmDataIO
aliceVision_cmdline
Boost::program_options
Boost::boost
Boost::timer
)

if (TARGET E57Format AND ALICEVISION_BUILD_MVS)
alicevision_add_software(aliceVision_importE57
SOURCE main_importE57.cpp
Expand Down
Loading
Loading