Improve perfomance of median calculation in LMedS algorithm
authorMatthew Self <dmz@mself.com>
Sat, 27 Aug 2016 03:39:38 +0000 (20:39 -0700)
committerMatthew Self <dmz@mself.com>
Sat, 27 Aug 2016 03:39:38 +0000 (20:39 -0700)
commit7de2e1e7957075ebbd504b2c9aea256e61b2d547
tree9ad325d9e97ca9d78540bbae60ae01204ced545f
parent40b870704edf3c89288a5cc7d81507e1103684c9
Improve perfomance of median calculation in LMedS algorithm

* Use `nth_element()` to find the median instead of `sort()` in `LMeDSPointSetRegistrator::run()`

* Improves performance of this part of LMedS from `n log(n)` to `n` by avoiding doing a full sort.

* Makes LMedS 2x faster for 100 points, 4x faster for 5,000 points in `EstimateAffine2D()`.

* LMedS is now never more than 2x slower than RANSAC and is faster in some cases.
modules/calib3d/src/ptsetreg.cpp