Below is a dummy snippet for computing covariance in ceres-solver
ceres::Covariance::Options covarianceOptions;
covarianceOptions.algorithm_type = ceres::SPARSE_QR;
ceres::Covariance covarianceComputation(covarianceOptions);
if( not covarianceComputation.Compute(paramBlocks, ceresProblem) ) {
// do stuff
}
else {
// return
}
When the ceresProblem
is not proper, covariance calculation may fail based on algorithm_type
. For example, the following error maybe displayed on console.
E0629 13:44:55.121646 9832 covariance_impl.cc:669] Jacobian matrix is rank deficient. Number of columns: 1204 rank: 1118
How can this console output / logging be suppressed? How to modify logging levels in ceres?
Related question: Ceres Solver: unable to disable logging (google glog), but does not address the above.
Setting the following environment variables would suppress logging in ceres:
GLOG_logtostderr=1
GLOG_stderrthreshold=3
GLOG_minloglevel=3
GLOG_v=-3
GLOG_logtostderr: Log messages to stderr instead of logfiles
GLOG_stderrthreshold: Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
GLOG_minloglevel: Log messages at or above this level. Again, the numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively
GLOG_v: Show all VLOG(m) messages for m less or equal the value of this flag. The numbers for levels INFO, WARNING, ERROR, and FATAL are 0, -1, -2, and -3
Reference: http://rpg.ifi.uzh.ch/docs/glog.html