The following issues were found

modules/features2d/src/matchers.cpp
1 issues
Same iterators expression are used for algorithm.
Style

Line: 417 CWE codes: 664

              DescriptorMatcher::DescriptorCollection::DescriptorCollection( const DescriptorCollection& collection )
{
    mergedDescriptors = collection.mergedDescriptors.clone();
    std::copy( collection.startIdxs.begin(), collection.startIdxs.begin(), startIdxs.begin() );
}

DescriptorMatcher::DescriptorCollection::~DescriptorCollection()
{}


            

Reported by Cppcheck.

modules/features2d/test/ocl/test_feature2d.cpp
1 issues
syntax error
Error

Line: 47

                  }
};

OCL_TEST_P(Feature2DFixture, KeypointsSame)
{
    EXPECT_EQ(keypoints.size(), ukeypoints.size());

    for (size_t i = 0; i < keypoints.size(); ++i)
    {

            

Reported by Cppcheck.

modules/features2d/test/test_affine_feature.cpp
1 issues
syntax error
Error

Line: 29

              }
#endif

TEST(Features2d_AFFINE_FEATURE, regression)
{
    Mat image = imread(cvtest::findDataFile("features2d/tsukuba.png"));
    string xml = cvtest::TS::ptr()->get_data_path() + "asift/regression_cpp.xml.gz";
    ASSERT_FALSE(image.empty());


            

Reported by Cppcheck.

modules/features2d/test/test_agast.cpp
1 issues
syntax error
Error

Line: 136

                ts->set_failed_test_info(cvtest::TS::OK);
}

TEST(Features2d_AGAST, regression) { CV_AgastTest test; test.safe_run(); }

}} // namespace

            

Reported by Cppcheck.

modules/features2d/test/test_akaze.cpp
1 issues
syntax error
Error

Line: 37

               * This is very hard to hit and depends a lot on particular allocator. Run this test in valgrind and check
 * for uninitialized values if you think you are hitting this problem again.
 */
TEST(Features2d_AKAZE, uninitialized_and_nans)
{
    Mat b1 = imread(cvtest::TS::ptr()->get_data_path() + "../stitching/b1.png");
    ASSERT_FALSE(b1.empty());

    vector<KeyPoint> keypoints;

            

Reported by Cppcheck.

modules/features2d/test/test_brisk.cpp
1 issues
syntax error
Error

Line: 106

                  }
}

TEST(Features2d_BRISK, regression) { CV_BRISKTest test; test.safe_run(); }

}} // namespace

            

Reported by Cppcheck.

modules/features2d/test/test_descriptors_invariance.impl.hpp
1 issues
syntax error
Error

Line: 78

              typedef DescriptorInvariance DescriptorScaleInvariance;
typedef DescriptorInvariance DescriptorRotationInvariance;

TEST_P(DescriptorRotationInvariance, rotation)
{
    Mat image1, mask1;
    const int borderSize = 16;
    Mat mask0(image0.size(), CV_8UC1, Scalar(0));
    mask0(Rect(borderSize, borderSize, mask0.cols - 2*borderSize, mask0.rows - 2*borderSize)).setTo(Scalar(255));

            

Reported by Cppcheck.

modules/features2d/test/test_descriptors_regression.cpp
1 issues
syntax error
Error

Line: 28

                  test.safe_run();
}

TEST( Features2d_DescriptorExtractor_BRISK, regression )
{
    CV_DescriptorExtractorTest<Hamming> test( "descriptor-brisk",
                                             (CV_DescriptorExtractorTest<Hamming>::DistanceType)2.f,
                                            BRISK::create() );
    test.safe_run();

            

Reported by Cppcheck.

modules/features2d/test/test_detectors_invariance.impl.hpp
1 issues
syntax error
Error

Line: 78

              typedef DetectorInvariance DetectorScaleInvariance;
typedef DetectorInvariance DetectorRotationInvariance;

TEST_P(DetectorRotationInvariance, rotation)
{
    Mat image1, mask1;
    const int borderSize = 16;
    Mat mask0(image0.size(), CV_8UC1, Scalar(0));
    mask0(Rect(borderSize, borderSize, mask0.cols - 2*borderSize, mask0.rows - 2*borderSize)).setTo(Scalar(255));

            

Reported by Cppcheck.

modules/features2d/test/test_detectors_regression.cpp
1 issues
syntax error
Error

Line: 27

                  test.safe_run();
}

TEST( Features2d_Detector_BRISK, regression )
{
    CV_FeatureDetectorTest test( "detector-brisk", BRISK::create() );
    test.safe_run();
}


            

Reported by Cppcheck.