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_averagePoseAveragePoseAveragePoseAveragepose_average computes the average rotation and translation of the poses passed in PosesPosesPosesPosesposesposes, and returns this average pose in AveragePoseAveragePoseAveragePoseAveragePoseaveragePoseaverage_pose. The poses can be weighted using the parameter WeightsWeightsWeightsWeightsweightsweights. 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_averagePoseAveragePoseAveragePoseAveragepose_average supports two modes for averaging the poses, which can be selected with the parameter ModeModeModeModemodemode. 'direct'"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""iterative" uses the average pose computed by the 'direct'"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 SigmaTSigmaTSigmaTSigmaTsigmaTsigma_t and SigmaRSigmaRSigmaRSigmaRsigmaRsigma_r, respectively. Both values can be set to 'auto'"auto""auto""auto""auto""auto", in which case they are automatically estimated. In this case, SigmaTSigmaTSigmaTSigmaTsigmaTsigma_t is set to the spread of the translations of the poses, and SigmaRSigmaRSigmaRSigmaRsigmaRsigma_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 QualityQualityQualityQualityqualityquality. QualityQualityQualityQualityqualityquality contains a tuple with four elements, which describe the average and maximum deviation of the passed poses from the returned average pose AveragePoseAveragePoseAveragePoseAveragePoseaveragePoseaverage_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 WeightsWeightsWeightsWeightsweightsweights are used in the Root-Mean-Square errors of translation and rotation, but not for the last two quality measures.

Execution Information

Parameters

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

Set of poses of which the average if computed.

WeightsWeightsWeightsWeightsweightsweights (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 value: []

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

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

Averaging mode.

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

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

SigmaTSigmaTSigmaTSigmaTsigmaTsigma_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 value: 'auto' "auto" "auto" "auto" "auto" "auto"

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

SigmaRSigmaRSigmaRSigmaRsigmaRsigma_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 value: 'auto' "auto" "auto" "auto" "auto" "auto"

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

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

Weighted mean of the poses.

QualityQualityQualityQualityqualityquality (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_averagePoseAveragePoseAveragePoseAveragepose_average returns TRUE. If necessary, an exception is raised.

Possible Predecessors

read_poseread_poseReadPoseReadPoseReadPoseread_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose

See also

read_poseread_poseReadPoseReadPoseReadPoseread_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose, pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3d

Module

Foundation