Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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.