Path: blob/master/modules/imgproc/perf/perf_morph.cpp
16354 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3#include "perf_precomp.hpp"45namespace opencv_test {67#define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC48#define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH))910PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH)11{12Size sz = get<0>(GetParam());13int type = get<1>(GetParam());1415Mat src(sz, type);16Mat dst(sz, type);1718declare.in(src, WARMUP_RNG).out(dst);1920int runs = (sz.width <= 320) ? 15 : 1;21TEST_CYCLE_MULTIRUN(runs) erode(src, dst, noArray());2223SANITY_CHECK(dst);24}2526PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH)27{28Size sz = get<0>(GetParam());29int type = get<1>(GetParam());3031Mat src(sz, type);32Mat dst(sz, type);3334declare.in(src, WARMUP_RNG).out(dst);3536TEST_CYCLE() dilate(src, dst, noArray());3738SANITY_CHECK(dst);39}4041} // namespace424344