pose_averageT_pose_averagePoseAveragePoseAveragepose_average (Operator)

Name

pose_averageT_pose_averagePoseAveragePoseAveragepose_average — Compute the average of a set of poses.

Signature

pose_average( : : Poses, Weights, Mode, SigmaT, SigmaR : AveragePose, Quality)

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

void PoseAverage(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 void HOperatorSet.PoseAverage(HTuple poses, HTuple weights, HTuple mode, HTuple sigmaT, HTuple sigmaR, out HTuple averagePose, out HTuple quality)

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)

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]]

Description

pose_averagepose_averagePoseAveragePoseAveragepose_average computes the average rotation and translation of the poses passed in PosesPosesPosesposesposes, and returns this average pose in AveragePoseAveragePoseAveragePoseaveragePoseaverage_pose. The poses can be weighted using the parameter WeightsWeightsWeightsweightsweights. 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_averagepose_averagePoseAveragePoseAveragepose_average supports two modes for averaging the poses, which can be selected with the parameter ModeModeModemodemode. 'direct'"direct""direct""direct""direct" selects a direct computation of the average, where the translation and rotation are averaged independently from each other. 'iterative'"iterative""iterative""iterative""iterative" uses the average pose computed by the 'direct'"direct""direct""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 SigmaTSigmaTSigmaTsigmaTsigma_t and SigmaRSigmaRSigmaRsigmaRsigma_r, respectively. Both values can be set to 'auto'"auto""auto""auto""auto", in which case they are automatically estimated. In this case, SigmaTSigmaTSigmaTsigmaTsigma_t is set to the spread of the translations of the poses, and SigmaRSigmaRSigmaRsigmaRsigma_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 QualityQualityQualityqualityquality. QualityQualityQualityqualityquality contains a tuple with four elements, which describe the average and maximum deviation of the passed poses from the returned average pose AveragePoseAveragePoseAveragePoseaveragePoseaverage_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 WeightsWeightsWeightsweightsweights are used in the Root-Mean-Square errors of translation and rotation, but not for the last two quality measures.

Execution Information

Parameters

PosesPosesPosesposesposes (input_control)  pose-array HPose, HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Set of poses of which the average if computed.

WeightsWeightsWeightsweightsweights (input_control)  number-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Empty tuple, or one weight per pose.

Default: []

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

ModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Averaging mode.

Default: 'iterative' "iterative" "iterative" "iterative" "iterative"

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

SigmaTSigmaTSigmaTsigmaTsigma_t (input_control)  number HTupleUnion[float, int, str]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Weight of the translation.

Default: 'auto' "auto" "auto" "auto" "auto"

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

SigmaRSigmaRSigmaRsigmaRsigma_r (input_control)  number HTupleUnion[float, int, str]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Weight of the rotation.

Default: 'auto' "auto" "auto" "auto" "auto"

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

AveragePoseAveragePoseAveragePoseaveragePoseaverage_pose (output_control)  pose HPose, HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Weighted mean of the poses.

QualityQualityQualityqualityquality (output_control)  number-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Deviation of the mean from the input poses.

Assertion: length(Quality) == 4

Result

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

Possible Predecessors

read_poseread_poseReadPoseReadPoseread_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose

See also

read_poseread_poseReadPoseReadPoseread_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose, pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3d

Module

Foundation