TL;DR (short answer):
As I understand it, the history parameter just sets the learning rate alpha of the algorithm like: 'alpha = 1 / history', i.e. exponentially decaying the weights of older frames. E.g., setting history=2 means alpha=1/2=0.5, so the newest frame is weighted 50%, the previous frame 25%, the one before the previous 12.5% and so on..
Your history value is likely much larger (the default value is 500, meaning learning rate alpha=1/500=0.002), so the exponential decay of the weights is much flatter. A nice visualization of exponential decay and the associated half-lives (currently) can be found at https://upload.wikimedia.org/wikipedi... (where the flattest curve represents alpha=0.01, i.e. history=100)
Btw thanks for asking that question! I've been struggling with it myself recently (and generally with the confusing organization and incomplete nature of OpenCV documentation over the years.. disclaimer: I do deeply love and heavily use OpenCV!,).
Long explanation:
This answer comes 2.5 years late and i hope the original poster has solved their problem, but just to spare/ease others the trouble I attempt to justify/substantiate my answer.
For a start, the most recent (and still as incomplete) documentation of the class can be found at https://docs.opencv.org/master/d7/d7b... (as long as they don't decide to change the organization of the docs again,)).
There, two papers are cited that explain the algorithm, the published versions of which reside at https://www.doi.org/10.1109/ICPR.2004... ['Zivkovic2004'] and https://doi.org/10.1016/j.patrec.2005... ['Zivkovic2006'], none of which are Open-Access (PDFs can be found searching for the papers e.g. on Google Scholar..)
[Side note: I do consider it questionable practice to outsource documentation of Open-Source code to Non-Open-Access publications (yet worlds better than close-sourcing the code,).. Also, imho, OpenCV could at least add such DOI-based permalinks to its bibliography to make things a teeny-weeny little less tedious..]
In Zivkovic2004, it says "Instead of the time interval T [the "history" parameter] that was mentioned above, here constant α describes an exponentially decaying envelope that is used to limit the influence of the old data. We keep the same notation having in mind that approximately α = 1/T."
Looking at the source code (which [again at time of writing] be found at https://github.com/opencv/opencv/blob... ), I find the "approximately" refers to the number of already available frames:
If fewer than the nframes specified in 'history' are available, the learning rate alpha is set to '1 / (2 * nframes)'.
See lines 779 and 869 [at time of writing]:
"learningRate = learningRate >= 0 && nframes > 1 ? learningRate : 1./std::min( 2*nframes, history );"
[My understanding of C++ is limited (being a Python Monty for years now,), maybe it says that as soon nframes is bigger than one, the learning rate alpha is set to 1/history (depending on other parts of ... (more)