pose_averageT_pose_averagePoseAveragePoseAveragepose_average (算子)
名称
pose_averageT_pose_averagePoseAveragePoseAveragepose_average — 计算一组姿态的平均值。
签名
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]]
描述
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.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
PosesPosesPosesPosesposesposes (输入控制) pose-array → HPose, HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Set of poses of which the average if computed.
WeightsWeightsWeightsWeightsweightsweights (输入控制) number-array → HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Empty tuple, or one weight per pose.
默认值:
[]
限制:
Weights > 0 && length(Weights) == 0 || length(Weights) == length(Poses) / 7
ModeModeModeModemodemode (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Averaging mode.
默认值:
'iterative'
"iterative"
"iterative"
"iterative"
"iterative"
"iterative"
值列表:
'direct'"direct""direct""direct""direct""direct", 'iterative'"iterative""iterative""iterative""iterative""iterative"
SigmaTSigmaTSigmaTSigmaTsigmaTsigma_t (输入控制) number → HTupleUnion[float, int, str]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Weight of the translation.
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 0.1, 1, 100
SigmaRSigmaRSigmaRSigmaRsigmaRsigma_r (输入控制) number → HTupleUnion[float, int, str]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Weight of the rotation.
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 0.1, 1, 10
AveragePoseAveragePoseAveragePoseAveragePoseaveragePoseaverage_pose (输出控制) pose → HPose, HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Weighted mean of the poses.
QualityQualityQualityQualityqualityquality (输出控制) number-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Deviation of the mean from the input poses.
Assertion:
length(Quality) == 4
结果
如果参数有效,算子 pose_averagepose_averagePoseAveragePoseAveragePoseAveragepose_average 返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
read_poseread_poseReadPoseReadPoseReadPoseread_pose,
hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose
另见
read_poseread_poseReadPoseReadPoseReadPoseread_pose,
hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose,
pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3d
模块
基础