I have sometimes also the problem getting totally wrong results for
yaw, pitch and roll. Yes, limits can help from converging to a local
minimum with wrong parameters. E.g. you may know that the rotation of
all images is nearly zero or nearly 90 degrees. Then you can force the
optimizer to keep rotation e.g. in -10 ... 10 degrees or 80 .. 100
degrees.
Since most cameras yield a good estimation of the FOV, I generally don't optimize the FOV.
Optimizing
FOV is generally a difficult task. If you must for some reason optimize
the FOV, try setting the initial FOV to a value that is higher than the
expected value.
Assume the FOVs that the
optimizer actually assumes are relatively small. If the optimizer makes
the FOVs smaller so that it goes to zero, the projection of the images
onto the unit sphere get smaller - nearly linear/proportional with the
FOV. And the error also gets smaller with the FOV. So the optimizer
would estimate FOVs of zero and would set the yaw, pitch and roll of all
images equal. All control points would be projected onto the same point
on the unit sphere.
Of course this in not what we want. To
prevent the optimizer from estimating a FOV of zero, the sum of squares
of the errors is artificially divided by the square of a factor being
proportional to the FOVs. To be accurate, this factor is equal to the
ratio of the
actual AVERAGE FOV of the images to the
initial
AVERAGE FOV of the image, so the error doesn't tend to zero if the FOV
goes to zero (and all yaw, pitch, roll tend to be equal).
In my version of libpano is probably not a bug
in the code. But when I compile it now, there seems to be some
incompatibilites with SuiteSparse or with libraries that
SuiteSparse
uses.