45 for (
unsigned i = 0; i < data->
mPositions.size(); i++)
60 for (
unsigned i = 0; i < data->
mFrames.size(); i++)
63 data->
mFrames[i].mPos = rMpr * prMt * tMv;
70 std::vector<double> error(data->
mFrames.size(), 1000);
75 for (
unsigned i_frame = 0; i_frame < data->
mFrames.size(); i_frame++)
77 std::vector<TimedPosition>::iterator posIter;
80 unsigned i_pos = distance(data->
mPositions.begin(), posIter);
87 double diff1 = fabs(data->
mFrames[i_frame].mTime - data->
mPositions[i_pos].mTime);
88 double diff2 = fabs(data->
mFrames[i_frame].mTime - data->
mPositions[i_pos + 1].mTime);
89 double diff = std::max(diff1, diff2);
93 if (!
similar(t_delta_tracking, 0))
94 t = (data->
mFrames[i_frame].mTime - data->
mPositions[i_pos].mTime) / t_delta_tracking;
96 error[i_frame] = diff;
105 Eigen::Quaterniond aq = Eigen::Quaterniond(a.matrix().block<3, 3>(0,0));
106 Eigen::Quaterniond bq = Eigen::Quaterniond(b.matrix().block<3, 3>(0,0));
108 Eigen::Quaterniond cq = aq.slerp(t, bq);
111 c.matrix().block<3, 3>(0, 0) = Eigen::Matrix3d(cq);
113 for (
int i = 0; i < 4; i++)
114 c(i, 3) = (1 - t) * a(i, 3) + t * b(i, 3);
121 for (
int i = 0; i < 4; i++)
122 for (
int j = 0; j < 4; j++)
123 c(i, j) = (1 - t) * a(i, j) + t * b(i, j);
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
Transform3D get_uMv() const
get transform from inverted image space v (origin in ul corner) to image space u. ...
Transform3D get_tMu() const
get transform from image space u to probe tool space t.