一、为了使自己的程序有很好的移植性,c++程序员应该尽量使用size_t和size_type而不是int, unsigned
1. size_t是全局定义的类型;size_type是STL类中定义的类型属性,用以保存任意string和vector类对象的长度
2. string::size_type 制类型一般就是unsigned int, 但是不同机器环境长度可能不同 win32 和win64上长度差别;size_type一般也是unsigned int
3. 使用的时候可以参考:
string::size_type a =123;
vector<int>size_type b=234;
size_t b=456;
4. size_t 使用的时候头文件需要 <cstddef> ;size_type 使用的时候需要<string>或者<vector>
5. sizeof(string::size_type)
sizeof(vector<bool>::size_type)
sizeof(vector<char>::size_type)
sizeof(size_t)
上述长度均相等,长度为win32:4 win64:8
二、imread第一个参数文件名,第二个参数输0即为读取灰度图 大于0参数读取RGB,小于0读取原始通道
三、triangulatePoints方法是opencv提供进行三角化恢复相对深度的方法
五个输入
rojMatr1 – 3x4 projection matrix of the first camera.
projMatr2 – 3x4 projection matrix of the second camera.
上面两个是SE3去掉第四行,两张图的pose
projPoints1 – 2xN array of feature points in the first image. In case
of c++ version it can be also a vector of feature points or two-channel
matrix of size 1xN or Nx1.
projPoints2 – 2xN array of corresponding
points in the second image. In case of c++ version it can be also a
vector of feature points or two-channel matrix of size 1xN or Nx1.
两张图的2D点,一一对应
points4D – 4xN array of reconstructed points in homogeneous coordinates.
输出是4维向量形式的齐次空间坐标
把输出的最后一维除到前三维上,得到3D点绝对坐标。注意此时只是将所有点的3D坐标尺度统一了,还是没有解出尺度是多少。
四、Mat的访问方式
https://www.cnblogs.com/korbin/p/5611217.html
点云配准和ICP算法以后需要再回来看吧
https://blog.csdn.net/zhouyelihua/article/details/77807541
这个博客写得挺好的