Implement the bundle adjustment by OpenCV library