A potential bug in FlannBasedMatcher?

In opencv\modules\features2d\src\matchers.cpp,

void FlannBasedMatcher::train()

    if( !flannIndex || mergedDescriptors.size() < addedDescCount )
        // FIXIT: Workaround for 'utrainDescCollection' issue (PR #2142)
        if (!utrainDescCollection.empty())
            CV_Assert(trainDescCollection.size() == 0);
            for (size_t i = 0; i < utrainDescCollection.size(); ++i)
        mergedDescriptors.set( trainDescCollection );
        flannIndex = makePtr<flann::Index>( mergedDescriptors.getDescriptors(), *indexParams );

the line flannIndex = makePtr<flann::Index>( mergedDescriptors.getDescriptors(), *indexParams ); takes 2 parameters in creating flann::Index object,

But in opencv\modules\flann\src\miniflann.cpp, line 379-386

Index::Index(InputArray _data, const IndexParams& params, flann_distance_t _distType)
    index = 0;
    featureType = CV_32F;
    distType = FLANN_DIST_L2;
    build(_data, params, _distType);

the constructor takes 3 parameters. Is it a potential bug?

depends. find the class definition (in some header file). if there is a default argument for the parameter, it should be okay.

Sorry, my fault, I didn’t not notice that the constructor has defined default value for the 3rd parameter in miniflann.hpp. it is not a issue.