1

I searched over all the websites and OpenCV documentation to understand the image stitching parameters, but it seems that there is no one can explain it!!!. There are also many users asked about this parameters, but there is no answer!!!

The parameters are :

setRegistrationResol( ); 
setSeamEstimationResol( ); 
setCompositingResol( ); 
setPanoConfidenceThresh( );

We need to understand it in order to optimize the stitching code in term of processing time and quality.

Can any one help us to understand it?? and why the OpenCV documentation didn't explain this parameters?!!

Thank you.

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30
  • I don't think anybody will answer you why the doc is incomplete ... – Bentoy13 Aug 10 '15 at 10:18
  • Duplicate of [this old post](http://stackoverflow.com/questions/28184629/optimize-stitching-image-with-opencv), but I won't flag the OP, there is no answer there. – Bentoy13 Aug 10 '15 at 10:19
  • And also duplicate of this [one](http://stackoverflow.com/questions/17106572/can-someone-pls-explain-the-parameters-from-opencv-stitcher-to-me), and no answer too. Frustrating! – Bentoy13 Aug 10 '15 at 10:40

1 Answers1

3

I can sure answer the first question, in fact the real question here. I worked a while ago on the stitching, and I can tell you that all the answers can be found directly in the code -- I won't blame you, it takes some time to find all the info.

Let's start by the fundamentals about the 3 first ones, dealing about resolution. Stithcing in OpenCV is quite slow, as you may have read across the net. To speed up the computation, OpenCV enables you to choose a different scaling from the original resolution of the input images. Detecting all features in a 1MPixel image is 4 times faster than detecting all features in a 4MPixel image, easy to understand.

So, for the first 3 parameters, you can change the resolution of the image only for one computation phase: setRegistrationResol changes the computation resolution of the registration phase, and so on. One key fact about the value itself is that it's in megapixels. Why is it so? Because OpenCV is deeply oriented towards "real-time" applications, so the developers try to use parameters to bound the maximal computation time. That's why the parameter itself is not in percentage of the input size, else it would depend on the input size.

Concerning the last one, I'm less confident about my answer. I think that parameter is related to the matching itself. During the matching phase, you need to find what are the matching relations between all images, or what image is matching with what images. During this computation, you can discard images which do not match with sufficient confidence with any other image, and I think this is the purpose of setPanoConfidenceThresh: set the confidence of accepting the image as part of the panorama.

For more information, start reading the code from the fantastic example in the source code of OpenCV, at [...]\samples\cpp\stitching_detailed.cpp. I remember that the complete workflow is exposed there.

Bentoy13
  • 4,886
  • 1
  • 20
  • 33
  • Thank you Bentoy13 for your answer but what I want to know exactly is how to determine the best value for these parameters to give me the best processing time and quality. – user2906086 Aug 12 '15 at 07:17
  • @user2906086 There is no rule for that. You need to perform some experiments, because the best values of parameters are strongly linked with the content of your images. – Bentoy13 Aug 12 '15 at 07:31