Minor refactoring of the GPU perf. sample
This commit is contained in:
parent
6ababe7055
commit
2ad7add613
@ -1187,16 +1187,16 @@ TEST(PyrLKOpticalFlow)
|
|||||||
|
|
||||||
TEST(FarnebackOpticalFlow)
|
TEST(FarnebackOpticalFlow)
|
||||||
{
|
{
|
||||||
const string names[] = {"rubberwhale", "basketball"};
|
const string datasets[] = {"rubberwhale", "basketball"};
|
||||||
for (size_t i = 0; i < sizeof(names)/sizeof(*names); ++i) {
|
for (size_t i = 0; i < sizeof(datasets)/sizeof(*datasets); ++i) {
|
||||||
for (int fastPyramids = 0; fastPyramids < 2; ++fastPyramids) {
|
for (int fastPyramids = 0; fastPyramids < 2; ++fastPyramids) {
|
||||||
for (int useGaussianBlur = 0; useGaussianBlur < 2; ++useGaussianBlur) {
|
for (int useGaussianBlur = 0; useGaussianBlur < 2; ++useGaussianBlur) {
|
||||||
|
|
||||||
SUBTEST << "dataset=" << names[i] << ", fastPyramids=" << fastPyramids << ", useGaussianBlur=" << useGaussianBlur;
|
SUBTEST << "dataset=" << datasets[i] << ", fastPyramids=" << fastPyramids << ", useGaussianBlur=" << useGaussianBlur;
|
||||||
Mat frame0 = imread(abspath(names[i] + "1.png"), IMREAD_GRAYSCALE);
|
Mat frame0 = imread(abspath(datasets[i] + "1.png"), IMREAD_GRAYSCALE);
|
||||||
Mat frame1 = imread(abspath(names[i] + "2.png"), IMREAD_GRAYSCALE);
|
Mat frame1 = imread(abspath(datasets[i] + "2.png"), IMREAD_GRAYSCALE);
|
||||||
if (frame0.empty()) throw runtime_error("can't open " + names[i] + "1.png");
|
if (frame0.empty()) throw runtime_error("can't open " + datasets[i] + "1.png");
|
||||||
if (frame1.empty()) throw runtime_error("can't open " + names[i] + "2.png");
|
if (frame1.empty()) throw runtime_error("can't open " + datasets[i] + "2.png");
|
||||||
|
|
||||||
gpu::FarnebackOpticalFlow calc;
|
gpu::FarnebackOpticalFlow calc;
|
||||||
calc.fastPyramids = fastPyramids;
|
calc.fastPyramids = fastPyramids;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user