本文整理汇总了C++中Measurement::getMarkerPair方法的典型用法代码示例。如果您正苦于以下问题:C++ Measurement::getMarkerPair方法的具体用法?C++ Measurement::getMarkerPair怎么用?C++ Measurement::getMarkerPair使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Measurement
的用法示例。
在下文中一共展示了Measurement::getMarkerPair方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeMeasurementScaleFactor
/**
* For measurement based scaling, we average the scale factors across the different marker pairs used.
* For each marker pair, the scale factor is computed by dividing the average distance between the pair
* in the experimental marker data by the distance between the pair on the model.
*/
double ModelScaler::computeMeasurementScaleFactor(const SimTK::State& s, const Model& aModel, const MarkerData& aMarkerData, const Measurement& aMeasurement) const
{
double scaleFactor = 0;
cout << "Measurement '" << aMeasurement.getName() << "'" << endl;
if(aMeasurement.getNumMarkerPairs()==0) return SimTK::NaN;
for(int i=0; i<aMeasurement.getNumMarkerPairs(); i++) {
const MarkerPair& pair = aMeasurement.getMarkerPair(i);
string name1, name2;
pair.getMarkerNames(name1, name2);
double modelLength = takeModelMeasurement(s, aModel, name1, name2, aMeasurement.getName());
double experimentalLength = takeExperimentalMarkerMeasurement(aMarkerData, name1, name2, aMeasurement.getName());
if(SimTK::isNaN(modelLength) || SimTK::isNaN(experimentalLength)) return SimTK::NaN;
cout << "\tpair " << i << " (" << name1 << ", " << name2 << "): model = " << modelLength << ", experimental = " << experimentalLength << endl;
scaleFactor += experimentalLength / modelLength;
}
scaleFactor /= aMeasurement.getNumMarkerPairs();
cout << "\toverall scale factor = " << scaleFactor << endl;
return scaleFactor;
}