![SE(3)](https://istack.dev59.com/1KcgE.gif)
R
是3x3旋转矩阵,t
是位姿的平移向量,详见这个问题。当一组位姿按顺序处理时,例如每个位姿都指代某个时间步长中相机的位姿时,旋转和平移分量可以累加如下: 以及 两者都可插入第一个方程中,得到给定时间步长下相机的相对位置。
我的问题是如何使用OpenCV或类似工具绘制这些点。对于一个以圆周运动围绕物体的相机,输出图应为圆形,原点位于轨迹起点。
以下是示例:
![enter image description here](https://istack.dev59.com/urG1y.webp)
简而言之:给定一组位姿,我们如何使用常见工具(如OpenCV、VTK、Matplotlib、MATLAB等)生成像上面那样的图。
R
是3x3旋转矩阵,t
是位姿的平移向量,详见这个问题。obtain axises vectors X,Y,Z
and position O
for each plot point
simply extract them form matrix. See Understanding 4x4 homogenous transform matrices. Now I do not know if your matrices are already inverse or not. So if your matrices represent camera coordinate system (not inverted) extract needed info directly. If not first invert the matrix and then extract.
If you got homogenuous transform matrix then you can do pseudo inverse by exploiting transpose operation. For more info see full pseudo inverse matrix.
Render each plot point
so first plot the axises as lines:
red_line(O,O+a*X);
green_line(O,O+a*Y);
blue_line(O,O+a*Z);
where a
is axis lines size. And after this plot a dot for the position
black_circle(O,r);
Where r
is some radius. You can use any gfx lib/engine for the plot. I would go for GDI or OpenGL but that depends solely on what are you familiar with.
BTW. to improve avarenes of the time line you can modulate the colors intensity (start with dark and end with bright colors so you see where the motion starts and ends ...)