Alignment¶
alignment ¶
estimate_alignment ¶
estimate_alignment(
trajectory: Trajectory,
other: Trajectory,
alignment_settings: AlignmentSettings | None = None,
matching_settings: MatchingSettings | None = None,
initial_parameters: AlignmentParameters | None = None,
) -> AlignmentResult
Estimates the alignment between two trajectories.
Performs Helmert, Leverarm, and Time shift estimation depending on the configuration. This function only estimates the alignment parameters, it does not apply them to the trajectory.
Parameters:
-
trajectory(Trajectory) –Trajectory to align.
-
other(Trajectory) –Reference trajectory to align to.
-
alignment_settings(AlignmentSettings, default:None) –Settings for the alignment process. Defaults to AlignmentSettings().
-
matching_settings(MatchingSettings, default:None) –Settings for the matching process. Defaults to MatchingSettings().
-
initial_parameters(AlignmentParameters, default:None) –Prior (e.g. from a manual alignment) used as start values of the least squares adjustment instead of the direct initialization. Parameters that are not estimated stay fixed at their prior value. Defaults to None.
Returns:
-
AlignmentResult(AlignmentResult) –Result of the alignment process.
Source code in trajectopy\processing\alignment.py
manual_alignment ¶
manual_alignment(
trajectory: Trajectory,
other: Trajectory,
parameters: AlignmentParameters,
) -> AlignmentResult
Creates an alignment result from manually chosen parameters (no estimation).
All parameters are marked as enabled so that their values are applied by apply_alignment.
Parameters:
-
trajectory(Trajectory) –Trajectory that is aligned.
-
other(Trajectory) –Reference trajectory.
-
parameters(AlignmentParameters) –Manually chosen alignment parameters.
Returns:
-
AlignmentResult(AlignmentResult) –Alignment result holding the manual parameters.
Source code in trajectopy\processing\alignment.py
apply_alignment ¶
apply_alignment(
trajectory: Trajectory,
alignment_result: AlignmentResult,
inplace: bool = True,
) -> Trajectory
Transforms trajectory using alignment parameters.
After computing the alignment parameters needed to align two trajectories, they can be applied to arbitrary trajectories.
Parameters:
-
trajectory(Trajectory) –Trajectory to apply alignment to.
-
alignment_result(AlignmentResult) –Alignment result containing transformation parameters.
-
inplace(bool, default:True) –Perform in-place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Aligned trajectory.
Source code in trajectopy\processing\alignment.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
adopt_first_pose ¶
adopt_first_pose(
trajectory: Trajectory,
other: Trajectory,
inplace: bool = True,
) -> Trajectory
Transform trajectory so that the first pose is identical in both.
Parameters:
-
trajectory(Trajectory) –Trajectory to transform.
-
other(Trajectory) –Reference trajectory.
-
inplace(bool, default:True) –Perform transformation in place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Transformed trajectory.
Source code in trajectopy\processing\alignment.py
adopt_first_position ¶
adopt_first_position(
trajectory: Trajectory,
other: Trajectory,
inplace: bool = True,
) -> Trajectory
Transform trajectory so that the first position is identical in both.
Parameters:
-
trajectory(Trajectory) –Trajectory to transform.
-
other(Trajectory) –Reference trajectory.
-
inplace(bool, default:True) –Perform transformation in place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Transformed trajectory.
Source code in trajectopy\processing\alignment.py
adopt_first_orientation ¶
adopt_first_orientation(
trajectory: Trajectory,
other: Trajectory,
inplace: bool = True,
) -> Trajectory
Transform trajectory so that the first orientation is identical in both.
Parameters:
-
trajectory(Trajectory) –Trajectory to transform.
-
other(Trajectory) –Reference trajectory.
-
inplace(bool, default:True) –Perform transformation in place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Transformed trajectory.
Source code in trajectopy\processing\alignment.py
align ¶
align(
trajectory: Trajectory,
other: Trajectory,
alignment_settings: AlignmentSettings | None = None,
matching_settings: MatchingSettings | None = None,
inplace: bool = True,
) -> Trajectory
Aligns the trajectory with another trajectory.
Parameters:
-
trajectory(Trajectory) –Trajectory to align.
-
other(Trajectory) –Reference trajectory.
-
alignment_settings(AlignmentSettings, default:None) –Settings for the alignment process. Defaults to AlignmentSettings().
-
matching_settings(MatchingSettings, default:None) –Settings for the matching process. Defaults to MatchingSettings().
-
inplace(bool, default:True) –Perform in-place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Aligned trajectory.