Hi everybody,
I'm newbie. I'm trying to use ceres with analytic derivatives in order to solve bundle ajusterment problem.
I know someone ask me why I don't use AutoDiffCostFunction but I've some reason to use analytic method.
Context: I have 2 cameras jointly moving, 30 poses and 15k point 3D.
Each observation, i.e. point 2d, corresponds to a triple of a camera, a pose and a point 3D which are identified by id_camera, id_pose, id_point.
15 parameters for each camera, 6 parameters for each pose, and 3 for each point 3D.
Vector<double*> parameters_blocks = <cam0> <cam1> <pose0> ... <pose29> <point3D_0> ... <point3D_14999>
I used linear solver = SPARSE_NORMAL_CHOLESKY.
Could anyone help me how to fill Jacobian matrix?
I tried to do it
" if (jacobians ==NULL) return true;
// For camera
for (int i = 0; i < 2; ++i) {
if (jacobians[i] != NULL) {
ceres::MatrixRef(jacobian[i], 2, 15).setZero();
if (i = id_camera) {
// fill jacobian[i][j] = ... ; j = 0 -> 29
}
}
}
// for pose
for (int k = 0; k < 30; ++k) {
int i = k + 2; // 2 cameras
if (jacobians[i] != NULL) {
ceres::MatrixRef(jacobian[i], 2, 6).setZero();
if (i = id_camera) {
// fill jacobian[i][j] = ... ; j = 0 -> 11
}
}
}
// for point3D
...
"
but I got an error:
"CHLMOD error: problem too large"
and "Linear solver failed due to unrecoverable non-numeric causes."
Something wrong but I don't know where.
Help me, please!