Jump to: navigation, search

Understanding the RMS value


Introduction

The problem solved by the optimizer can be seen as a curve fitting problem: given a curve model (e.g. y=a*X+b) find the parameters (a and b) that make the curve fit at best to a series of data points.
In the context of panorama stitching, the model is the equation of projection of a 3D scene point to a 2D picture pixel and the parameters are the calibration unknowns and the orientation of each image.


legend

Steps of a successful optimization

Input

The input of the optimizer is in two parts:

  • The model of the problem. In the case of image stitching, this is essentially the type of lens used (standard or fisheye). In this exemplification, we'll replace it by a simpler one: the 2D line defined by y=a*x+b
  • The data. The data is a set of points that are supposed to be generated by the model. In the case of image stitching, they are the matched control points coming from the detector.

The goal of the optimizer is to estimate the parameters of the model (a and b) from the data points.

The truth: a and b are the 2 parameters to estimate
What the optimizer sees as input

There are actually two types of data points. Inliers: they are good points but never perfectly accurate. Outliers: they are points completely wrong (mismatched control points from different parts of the panorama)

Some of the input control points are good but not perfectly accurate
Some of the input control points are completely wrong


Steps

1) First estimation of the model parameters to fit at best all the control points
2) Bad points cleaning threshold
3) After applying bad points cleaning
4) Re-estimation of the model paramters
5) Final RMS computation


Result

Final estimation vs. ground truth: here the estimation is good
The final RMS value is the mean size of these error segments



Two common mistakes

Decreasing the RMS by cleaning too much

We resume from step 2) with a lower bad points cleaning threshold.

Too low bad points cleaning threshold
After applying bad points cleaning
Final estimation vs. ground truth: the estimation is bad


Comparison


Decreasing the RMS by adding more unknowns

Let us imagine one want to stitch 3 pictures from the same camera with the same settings.
In automatic mode, the optimizer will try to estimate one global calibration for the 3 pictures.
But, the optimizer can also be manually asked to find the calibration of each picture independently.
In our example, it would be like trying to fit at best the data points with 3 pieces of line instead of one unique line.
By increasing unnecessarily the number of unknowns to be estimated like this, one will always get a lower final RMS, but the result will very often be worse.


If the number of unknowns is higher than necessary, the final RMS is lower but the result is often worse.
Comparison

Practical example

In this documentation page you can find a stitching result with and without unknown sharing.
Both are computed without point clean. The RMS without sharing is better than with (2.33 vs. 2.43) but the result with sharing is far better.

Conclusion

  • The RMS is a measure of error between a point and the current estimation, NOT the ground truth which is unknown
  • It is always possible to decrease the global RMS by cleaning more points or adding unnecessary unknowns, but this does not always lead to a better result









BACK TO: Documentation / Autopano Documentation

Retrieved from "http://www.kolor.com/wiki-en/index.php?title=Understanding_the_RMS_value&oldid=24946"