// check brisque model/range persistence TEST(TEST_CASE_NAME, model_persistence ) { auto ptr = create_brisque(); auto fn = [&ptr]() { quality_test(ptr, get_testfile_1a(), BRISQUE_EXPECTED_1, false, true); }; fn(); fn(); // model/range should persist with brisque ptr through multiple invocations }
// check compute features interface method TEST(TEST_CASE_NAME, compute_features) { auto ptr = create_brisque(); cv::Mat features; ptr->computeFeatures(get_testfile_1a(), features); EXPECT_EQ(features.rows, 1); EXPECT_EQ(features.cols, 36); }
// static method TEST(TEST_CASE_NAME, static_ ) { quality_expect_near( quality::QualityBRISQUE::compute( get_testfile_1a() , cvtest::findDataFile(MODEL_FNAME, false) , cvtest::findDataFile(RANGE_FNAME, false) ) , BRISQUE_EXPECTED_1 ); }
inline std::vector<cv::Mat> get_testfile_1a2a() { return { get_testfile_1a(), get_testfile_2a() }; }
// single channel, instance method, with and without opencl TEST(TEST_CASE_NAME, single_channel ) { auto fn = []() { quality_test(create_brisque(), get_testfile_1a(), BRISQUE_EXPECTED_1, false, true ); }; OCL_OFF( fn() ); OCL_ON( fn() ); }
// single channel, with and without opencl TEST(TEST_CASE_NAME, single_channel ) { auto fn = []() { quality_test(quality::QualityMSE::create(get_testfile_1a()), get_testfile_1b(), MSE_EXPECTED_1); }; OCL_OFF( fn() ); OCL_ON( fn() ); }
// static method TEST(TEST_CASE_NAME, static_ ) { std::vector<cv::Mat> qMats = {}; quality_expect_near(quality::QualityMSE::compute(get_testfile_1a(), get_testfile_1a(), qMats), cv::Scalar(0.)); // ref vs ref == 0 EXPECT_EQ(qMats.size(), 1U); }