Search code examples
c++opencvimage-stitchingopencv-stitching

OpenCV stitching result's dimensions isn't stable


I am using OpenCV to make panorama.
But the result's dimensions aren't stable and whole stitching isn't stable.
Everytime I get different results.
Can somebody help me to understand what is the reason, or what part os the stitching pipeline isn't stable?
I am doing the most simple version of stitching, using stitch function.
Thank you.


Solution

  • As stitching relies on RANSAC algorithm and it has some degree of randomness (in fact RANSAC stands for Random sample consensus), its results are not stable.

    I would pre-seed the random generator before any stitching operation to make the results repeatables.

    http://www.cplusplus.com/reference/cstdlib/srand/