MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TEST

Function TEST

test/meanshift.cpp:133–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131using af::span;
132
133TEST(Meanshift, Color_CPP) {
134 IMAGEIO_ENABLED_CHECK();
135
136 vector<dim4> inDims;
137 vector<string> inFiles;
138 vector<dim_t> outSizes;
139 vector<string> outFiles;
140
141 readImageTests(string(TEST_DIR "/meanshift/color.test"), inDims, inFiles,
142 outSizes, outFiles);
143
144 size_t testCount = inDims.size();
145
146 for (size_t testId = 0; testId < testCount; ++testId) {
147 inFiles[testId].insert(0, string(TEST_DIR "/meanshift/"));
148 outFiles[testId].insert(0, string(TEST_DIR "/meanshift/"));
149
150 array img = loadImage(inFiles[testId].c_str(), true);
151 array gold = loadImage(outFiles[testId].c_str(), true);
152 dim_t nElems = gold.elements();
153 array output = meanShift(img, 3.5f, 30.f, 5, true);
154
155 ASSERT_IMAGES_NEAR(gold, output, 0.02f);
156 }
157}
158
159TEST(Meanshift, GFOR) {
160 dim4 dims = dim4(10, 10, 3);

Callers

nothing calls this directly

Calls 8

readImageTestsFunction · 0.85
loadImageFunction · 0.85
constantFunction · 0.85
absFunction · 0.70
meanShiftFunction · 0.50
dim4Class · 0.50
iotaFunction · 0.50
elementsMethod · 0.45

Tested by

no test coverage detected