I'm trying to do image mosaicing according to this example of MATLAB:
My images are captured in an approximate vertical column. What the code does, is to find all the transformation with respect to the first image. i.e. :
tforms(n).T = tforms(n-1).T * tforms(n).T;
Then, it starts stitching (warping) the images based on the obtained transformations above. The code works well when stitching 3-4 images. But starts to give this popular warning after that! I'm trying to stitch about 25 images and with the start of this warning the images are not stitched properly:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.679189e-08. > In affine2d>affine2d.get.Tinv at 339 In affine2d>affine2d.transformPointsInverse at 214 In imwarp>remapAndResampleGeneric2d at 248 In imwarp>remapPointsAndResample at 188 In imwarp at 173
Could anyone suggest how to solve this problem? From physical point of view, this procedure must work, but how to fix this mathematical shortcoming? To give you an idea of the resulting error, here you can see one ill-conditioned transformation matrix and the final mosaic:
1.0e+03 * 0.0010 -0.0000 0 0.0000 0.0010 0 -0.0592 -5.8776 0.0010
Best Answer