Understanding how cv::detail::leaveBiggestComponent() function works in opencv 3.2

asked 2017-05-25 09:54:22 -0500

DaePa gravatar image

I am having troubles understanding how the function cv::detail::leaveBiggestComponent works, as little to no documentation is available.

I know what the function is supposed to do, that is, given a set of keypoint matches between images, returning the largest subset of images with consistent matches. In addition, according to what its implementations states, it should also remove image duplicates.

The function is part of the Stitching Pipeline of opencv, and, if one refers to Brown and Lowe paper, should perform as panorama recognition module.

However, when it comes to breaking down the code, I can't really understand how this is done.

TL;DR I'm looking for a pseudocode explanation of the flowchart of cv::detail::leaveBiggestComponent(), please help.

The code implementation is here. It calls relevant code (with no documentation either) from here (implementation) and here (headers).

Of particular interest is the working principle of cv::detail::DisjointSets(), too.

edit retag flag offensive close merge delete