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
95 changes: 95 additions & 0 deletions meshroom/aliceVision/SfmExpanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,101 @@ class SfMExpanding(desc.AVCommandLineNode):
"by avoiding computation of the Bundle Adjustment on areas that are not changing.",
value=True,
),
desc.BoolParam(
name="useTemporalConstraint",
label="Temporal Constraint",
description="Adds a temporal smoothness constraint to the bundle adjustment.",
value=False,
),
desc.FloatParam(
name="tscPositionWeight",
label="Temporal Constraint Position Weight",
description="Controls the weight of the temporal constraint applied to camera positions. Higher values enforce smoother camera path.",
value=10.0,
range=(0.0, 100.0, 0.1),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscOrientationWeight",
label="Temporal Constraint Orientation Weight",
description="Controls the weight of the temporal constraint applied to camera orientations. Higher values enforce smoother camera rotation.",
value=10.0,
range=(0.0, 100.0, 0.1),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscRegularizationWeight",
label="Temporal Constraint Regularization Weight",
description="Controls the strength of regularization applied to the temporal constraint.",
value=0.0,
range=(0.0, 100.0, 0.1),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC0positionWeight",
label="Temporal Constraint C0 Position Weight",
description="Controls the weight of the continuity constraint on camera positions in the temporal constraint. Higher values enforce smoother transitions in position, reducing abrupt changes of position.",
value=0.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC1positionWeight",
label="Temporal Constraint C1 Position Weight",
description="Controls the weight of the first derivative of camera position in the temporal constraint. Higher values enforce continuity of the camera velocity, reducing abrupt changes of velocity.",
value=1.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC2positionWeight",
label="Temporal Constraint C2 Position Weight",
description="Controls the weight of the second derivative of camera position in the temporal constraint. Higher values enforce continuity of the camera acceleration, reducing abrupt changes of acceleration.",
value=1.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC0orientationWeight",
label="Temporal Constraint C0 Orientation Weight",
description="Controls the weight of the continuity constraint on camera orientation in the temporal constraint. Higher values enforce smoother transitions, reducing abrupt changes of the camera orientation.",
value=0.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC1orientationWeight",
label="Temporal Constraint C1 Orientation Weight",
description="Controls the weight of the first derivative of camera orientation in the temporal constraint. Higher values enforce continuity of the rotation velocity, reducing abrupt changes of rotation velocity.",
value=1.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.FloatParam(
name="tscC2orientationWeight",
label="Temporal Constraint C2 Orientation Weight",
description="Controls the weight of the second derivative of camera orientation in the temporal constraint. Higher values enforce continuity of the rotation acceleration, reducing abrupt changes of rotation acceleration.",
value=1.0,
range=(0.0, 1.0, 0.01),
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.BoolParam(
name="exitAfterPoseInterpolation",
label="Only Pose Interpolation",
description="Exit after pose interpolation, before bundle adjustment. (for debug)",
value=False,
advanced=True,
enabled=lambda node: node.useTemporalConstraint.value,
),
desc.IntParam(
name="localBAGraphDistance",
label="LocalBA Graph Distance",
Expand Down
8 changes: 8 additions & 0 deletions meshroom/aliceVision/TracksSimulating.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class TracksSimulating(desc.AVCommandLineNode):
invalidate=True,
advanced=True,
),
desc.BoolParam(
name="randomNoiseVariancePerView",
label="Random Variance Per View",
description="Use different noise variance per view.",
value=False,
invalidate=True,
advanced=True,
),
desc.ChoiceParam(
name="verboseLevel",
label="Verbose Level",
Expand Down
2 changes: 2 additions & 0 deletions src/aliceVision/sfm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
set(sfm_bundle_files_headers
bundle/BundleAdjustment.hpp
bundle/BundleAdjustmentCeres.hpp
utils/poseFilter.hpp
)

# Sources
set(sfm_bundle_files_sources
bundle/BundleAdjustmentCeres.cpp
utils/poseFilter.cpp
)

set(sfm_files_headers
Expand Down
14 changes: 14 additions & 0 deletions src/aliceVision/sfm/bundle/BundleAdjustment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ inline std::istream& operator>>(std::istream& in, EFeatureConstraint& m)
return in;
}

struct TemporalConstraintParams
{
double positionWeight = 10.0;
double orientationWeight = 10.0;
double regularizationWeight = 0.0;
double c0positionWeight = 0.0;
double c1positionWeight = 1.0;
double c2positionWeight = 1.0;
double c0orientationWeight = 0.0;
double c1orientationWeight = 1.0;
double c2orientationWeight = 1.0;
};

class BundleAdjustment
{
public:
Expand Down Expand Up @@ -102,6 +115,7 @@ class BundleAdjustment
REFINE_INTRINSICS_OPTICALOFFSET_IF_ENOUGH_DATA = 32, //< refine the optical offset only if we have a minimum number of cameras
REFINE_INTRINSICS_DISTORTION = 64, //< refine the distortion parameters
REFINE_STRUCTURE_AS_NORMALS = 128, //< Structure lies on a sphere (Pure rotation)
REFINE_TEMPORAL_SMOOTHNESS_CONSTRAINT = 256, //< add a temporal constraint to smooth camera positions/orientation
/// Refine all intrinsics parameters
REFINE_INTRINSICS_ALL = REFINE_INTRINSICS_FOCAL | REFINE_INTRINSICS_OPTICALOFFSET_IF_ENOUGH_DATA | REFINE_INTRINSICS_DISTORTION,
/// Refine all parameters
Expand Down
Loading
Loading