最近在ubuntu20.04上ceres为2.2.0下,编译opencv4.5.5和opencv_contrib4.5.5时出现如下报错:
在opencv_contrib-4.5.5/modules/sfm/libmv_light/libmv/simple_pipeline/bundle.cc中出现
“error: ‘SubsetParameterization’ is not a member of ‘ceres’
error: ‘class ceres::Problem’ has no member named ‘SetParameterization’; did you mean ‘SetParameterLowerBound’?“
经过查询发现在ceres2.2.0版本后将这个语句剔除,导致无法编译通过。
可使用SubsetManifold代替SubsetParameterization:
// ceres::SubsetParameterization *constant_translation_parameterization = NULL;
ceres::SubsetManifold *constant_translation_parameterization = NULL;
可使用SetManifold代替SetParameterization
/*problem.SetParameterization(current_camera_R_t,constant_translation_parameterization);*/
problem.SetManifold(current_camera_R_t,constant_translation_parameterization);