Beispiel #1
0
	bool AbsSecondDerivativeHistogramAutoTest(int width, int height, int step, int indent, const FuncASDH & f1, const FuncASDH & f2)
	{
		bool result = true;

		TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "] (" << step << ", " << indent << ").");

		View s(int(width), int(height), View::Gray8, NULL, TEST_ALIGN(width));
		FillRandom(s);

		Histogram h1 = {0}, h2 = {0};

		TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(s, step, indent, h1));

		TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(s, step, indent, h2));

		result = result && Compare(h1, h2, 0, true, 32);

		return result;
	}
Beispiel #2
0
    bool AbsSecondDerivativeHistogramDataTest(bool create, int width, int height, const FuncASDH & f)
    {
        bool result = true;

        Data data(f.description);

        std::cout << (create ? "Create" : "Verify") << " test " << f.description << " [" << width << ", " << height << "]." << std::endl;

        View src(width, height, View::Gray8, NULL, TEST_ALIGN(width));

        size_t step = 1, indent = 16;
        Histogram h1, h2;

        if(create)
        {
            FillRandom(src);

            TEST_SAVE(src);

            f.Call(src, step, indent, h1);

            TEST_SAVE(h1);
        }
        else
        {
            TEST_LOAD(src);

            TEST_LOAD(h1);

            f.Call(src, step, indent, h2);

            TEST_SAVE(h2);

            result = result && Compare(h1, h2, 0, true, 32);
        }

        return result;
    }