3 auto v1 = m_rot[1,3]*m_beacon[3]+m_rot[1,2]*m_beacon[2]+m_beacon[1]*m_rot[1,1]+xlate[1];
4 auto v2 = m_beacon[3]*m_rot[3,3]+m_beacon[2]*m_rot[3,2]+m_beacon[1]*m_rot[3,1]+xlate[3];
7 auto v5 = m_rot[2,3]*m_beacon[3]+m_beacon[2]*m_rot[2,2]+m_beacon[1]*m_rot[2,1]+xlate[2];
8 Eigen::Matrix<double,2,3> ret;
10 m_rot[1,1]*v4*fl-v1*m_rot[3,1]*v3*fl,
11 m_rot[1,2]*v4*fl-v1*m_rot[3,2]*v3*fl,
12 m_rot[1,3]*v4*fl-v1*m_rot[3,3]*v3*fl,
13 m_rot[2,1]*v4*fl-v5*m_rot[3,1]*v3*fl,
14 m_rot[2,2]*v4*fl-v5*m_rot[3,2]*v3*fl,
15 m_rot[2,3]*v4*fl-v5*m_rot[3,3]*v3*fl;
18 matrixIndexPattern = re.compile(
r'\[([0-9]),([0-9])]', re.VERBOSE)
19 def replaceMatrixIndices(inString):
21 return '({}, {})'.format(int(match.group(1)) - 1, int(match.group(2)) - 1)
23 return matrixIndexPattern.sub(matchfunc, inString)
25 vectorIndexPattern = re.compile(
r'\[([0-9])]', re.VERBOSE)
26 def replaceVectorIndices(inString):
28 return '[{}]'.format(int(match.group(1)) - 1)
29 return vectorIndexPattern.sub(matchfunc, inString)
32 def __init__(self, inString):
33 self.
_string = replaceVectorIndices(replaceMatrixIndices(inString))
35 def replace(self, old, new):
36 self.
_string = self._string.replace(old, new)
41 ).replace(
'principalPoint',
'm_cam.principalPoint'
42 ).replace(
'v2^2',
'(v2*v2)'
43 ).replace(
'fl',
'm_cam.focalLength'
44 ).replace(
'xlate',
'm_xlate'