Hi,
I want to find the position and orientation of a Pan Tilt camera when I know several x,y,z target point (center of the camera) and the corresponding pan,tilt of the camera. We do this with around 10 points. We create a cost function that calculate the two residual error for pan and tilt (calculate from translation, orientation matrix and x,y,z point to estimate the difference of the calculated pan to the readed pan and equivalent for tilt).
We create a LossfunctionWrapper (new Ceres::huberLoss(lossfunctionvalue), ceres::TakeOwnership).
for (int i;countcorrespondancepoint)
{
ceres::CostFunction *costfunction=new Ceres::AutoDiffCostFunction(....;
problem.addResidualBlock(costfunction,....
problem.setParameterBlockConstant(coord3D);
}
then solve the with Dense_QR solver type, Jacobi preconditionner...
We don't find a good solution at this end and I have the following report:
Parameter Blocks : original 17. reduced 2
Parameters 51. 6
ResidualBlocks (with 15 points). 15. 15
Residual. 30 30
the initial cost is equal to the final cost 7.8e+03
I have one iteration that is successfull and the termination is Convergence (fucntion tolerance reached )
I guess we have a correct lossfunction but it seems something is wrong.
1)- Is it normal to have the initial and final cost ?
2)- is it normal to have parameters blocks that go from 17 to 2 ?
3)- because the coord3 is the original parametre, does it makes senses to make it constant to indicate that this parameter is not to changed and is not the one to evaluate (In fact I need to evaluate 3 translation values and 3 rotation values ?
4)- Is Ceres the good lib to do this ?
thanks