Skip to content

pose_averagePoseAveragePoseAveragepose_averageT_pose_average🔗

Short description🔗

pose_averagePoseAveragePoseAveragepose_averageT_pose_average — Compute the average of a set of poses.

Signature🔗

pose_average( pose Poses, number Weights, string Mode, number SigmaT, number SigmaR, out pose AveragePose, out number Quality )void PoseAverage( const HTuple& Poses, const HTuple& Weights, const HTuple& Mode, const HTuple& SigmaT, const HTuple& SigmaR, HTuple* AveragePose, HTuple* Quality )static void HOperatorSet.PoseAverage( HTuple poses, HTuple weights, HTuple mode, HTuple sigmaT, HTuple sigmaR, out HTuple averagePose, out HTuple quality )def pose_average( poses: Sequence[int], weights: Sequence[Union[float, int]], mode: str, sigma_t: Union[float, int, str], sigma_r: Union[float, int, str] ) -> Tuple[Sequence[Union[float, int]], Sequence[float]]

Herror T_pose_average( const Htuple Poses, const Htuple Weights, const Htuple Mode, const Htuple SigmaT, const Htuple SigmaR, Htuple* AveragePose, Htuple* Quality )

static HPose HPose::PoseAverage( const HPoseArray& Poses, const HTuple& Weights, const HString& Mode, const HTuple& SigmaT, const HTuple& SigmaR, HTuple* Quality )

static HPose HPose::PoseAverage( const HPoseArray& Poses, const HTuple& Weights, const HString& Mode, double SigmaT, double SigmaR, HTuple* Quality )

static HPose HPose::PoseAverage( const HPoseArray& Poses, const HTuple& Weights, const char* Mode, double SigmaT, double SigmaR, HTuple* Quality )

static HPose HPose::PoseAverage( const HPoseArray& Poses, const HTuple& Weights, const wchar_t* Mode, double SigmaT, double SigmaR, HTuple* Quality ) (Windows only)

static HPose HPose.PoseAverage( HPose[] poses, HTuple weights, string mode, HTuple sigmaT, HTuple sigmaR, out HTuple quality )

static HPose HPose.PoseAverage( HPose[] poses, HTuple weights, string mode, double sigmaT, double sigmaR, out HTuple quality )

Description🔗

pose_averagePoseAverage computes the average rotation and translation of the poses passed in Posesposesposes, and returns this average pose in AveragePoseaveragePoseaverage_pose. The poses can be weighted using the parameter Weightsweightsweights. If an empty tuple is passed as weight, all poses have the same influence on the result. Otherwise, a tuple that contains one positive weight per pose needs to be passed. A higher weight leads to a higher influence of that pose on the average.

pose_averagePoseAverage supports two modes for averaging the poses, which can be selected with the parameter Modemodemode. 'direct'"direct" selects a direct computation of the average, where the translation and rotation are averaged independently from each other. 'iterative'"iterative" uses the average pose computed by the 'direct'"direct" method as initial value for an iterative method, which computes the local mode of the poses. The iterative method is slower than the direct method. However, it returns more accurate poses especially in the presence of outlier poses, as such outliers are downweighted automatically.

For the iterative method, the relative weight of the translation and the rotation can be set with the parameters SigmaTsigmaTsigma_t and SigmaRsigmaRsigma_r, respectively. Both values can be set to 'auto'"auto", in which case they are automatically estimated. In this case, SigmaTsigmaTsigma_t is set to the spread of the translations of the poses, and SigmaRsigmaRsigma_r is set to a constant value. Both values describe the expected spread of the translation and the rotation, and influence the weighting of the poses. For the direct method, both parameters are ignored.

A measure of the quality of the computed pose is returned in Qualityqualityquality. Qualityqualityquality contains a tuple with four elements, which describe the average and maximum deviation of the passed poses from the returned average pose AveragePoseaveragePoseaverage_pose. The order of the values is: Root-Mean-Square error of the translation, Root-Mean-Square error of the rotation, maximum translation and maximum rotation deviation. The weights passed in Weightsweightsweights are used in the Root-Mean-Square errors of translation and rotation, but not for the last two quality measures.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Posesposesposes (input_control) pose-array → (integer)HTuple (Hlong)HPose, HTuple (int / long)Sequence[int]Htuple (Hlong)

Set of poses of which the average if computed.

Weightsweightsweights (input_control) number-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Empty tuple, or one weight per pose.

Default: [][]
Restriction: Weights > 0 && (length(Weights)==0 || length(Weights)==length(Poses)/7)

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Averaging mode.

Default: 'iterative'"iterative"
List of values: 'direct', 'iterative'"direct", "iterative"

SigmaTsigmaTsigma_t (input_control) number → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)Union[float, int, str]Htuple (double / Hlong / char*)

Weight of the translation.

Default: 'auto'"auto"
Suggested values: 'auto', 0.1, 1, 100"auto", 0.1, 1, 100

SigmaRsigmaRsigma_r (input_control) number → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)Union[float, int, str]Htuple (double / Hlong / char*)

Weight of the rotation.

Default: 'auto'"auto"
Suggested values: 'auto', 0.1, 1, 10"auto", 0.1, 1, 10

AveragePoseaveragePoseaverage_pose (output_control) pose → (real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Weighted mean of the poses.

Qualityqualityquality (output_control) number-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Deviation of the mean from the input poses.

Assertion: length(Quality)==4

Result🔗

If the parameters are valid, the operator pose_averagePoseAverage returns 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_poseReadPose, hom_mat3d_to_poseHomMat3dToPose

See also

read_poseReadPose, hom_mat3d_to_poseHomMat3dToPose, pose_to_hom_mat3dPoseToHomMat3d

Module🔗

Foundation