I am currently using the ICP to register Lidar point clouds in two frames. The problem is that the translation value calculated by the difference of average point values of utilized points in two frames seems not precise enough. Is there any alternative solutions to calculate the translation?
If you are trying to register two point clouds without a proper initial guess on the alignment (6dof) than it is a global registration problem. The simplest way is combining 3D feature matchings with ICP. Find the initial guess by 3D feature matching and refine it by point-to-point or point-to-plane ICP. Open3D has some example code on that.
To align two point clouds there are mainly two ways depending on your knowledge of the point clouds.
- If you know that the incoming point cloud is roughly aligned with your model or previous frame you can try different types of ICP as explained here Different types may be generalizedicp, coloredicp etc. The main difference is how they estimate the transformation matrix which is a deep topic for this answer. Also ICP is not randomized, which means you get the same result after every execution.
- However, If you don't know the incoming point cloud, which is the case for SLAM or low fps & high ROI cameras, you have to create a feature array of each point, or you might think voxel downsampling for faster processing, which will be calculated based upon the neighbors of the point and the relation between them such as point normal, distance, covariance if exists etc. So, after that if you do it for both point clouds you will get 2 arrays which will actually hold the information you need when you decide whether two points are correspondance or not. There is also two different function for this purpose implemented in open3d. It is a common practice to apply icp after global registration to refine the transformation. These two algorithms has each pros and cons you need to consider, for example RANSAC is randomized, meaning you may not get the same result for the same two point clouds etc.