forked from opencv/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opencv#8580 from terfendail:ovx_newperftest
- Loading branch information
Showing
7 changed files
with
313 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "perf_precomp.hpp" | ||
|
||
using namespace std; | ||
using namespace cv; | ||
using namespace perf; | ||
|
||
typedef perf::TestBaseWithParam<Size> SizePrm; | ||
|
||
PERF_TEST_P( SizePrm, LUT, | ||
testing::Values(szQVGA, szVGA, sz1080p) | ||
) | ||
{ | ||
Size sz = GetParam(); | ||
|
||
int maxValue = 255; | ||
|
||
Mat src(sz, CV_8UC1); | ||
randu(src, 0, maxValue); | ||
Mat lut(1, 256, CV_8UC1); | ||
randu(lut, 0, maxValue); | ||
Mat dst(sz, CV_8UC1); | ||
|
||
TEST_CYCLE() LUT(src, lut, dst); | ||
|
||
SANITY_CHECK(dst, 0.1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#include "perf_precomp.hpp" | ||
|
||
using namespace std; | ||
using namespace cv; | ||
using namespace perf; | ||
using std::tr1::get; | ||
|
||
#ifdef HAVE_OPENVX | ||
PERF_TEST_P(Size_MatType, Accumulate, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_16SC1, CV_32FC1) | ||
) | ||
) | ||
#else | ||
PERF_TEST_P( Size_MatType, Accumulate, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_32FC1) | ||
) | ||
) | ||
#endif | ||
{ | ||
Size sz = get<0>(GetParam()); | ||
int dstType = get<1>(GetParam()); | ||
|
||
Mat src(sz, CV_8UC1); | ||
Mat dst(sz, dstType); | ||
|
||
declare.time(100); | ||
declare.in(src, WARMUP_RNG).out(dst); | ||
|
||
TEST_CYCLE() accumulate(src, dst); | ||
|
||
SANITY_CHECK(dst); | ||
} | ||
|
||
#ifdef HAVE_OPENVX | ||
PERF_TEST_P(Size_MatType, AccumulateSquare, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_16SC1, CV_32FC1) | ||
) | ||
) | ||
#else | ||
PERF_TEST_P( Size_MatType, AccumulateSquare, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_32FC1) | ||
) | ||
) | ||
#endif | ||
{ | ||
Size sz = get<0>(GetParam()); | ||
int dstType = get<1>(GetParam()); | ||
|
||
Mat src(sz, CV_8UC1); | ||
Mat dst(sz, dstType); | ||
|
||
declare.time(100); | ||
declare.in(src, WARMUP_RNG).out(dst); | ||
|
||
TEST_CYCLE() accumulateSquare(src, dst); | ||
|
||
SANITY_CHECK(dst); | ||
} | ||
|
||
#ifdef HAVE_OPENVX | ||
PERF_TEST_P(Size_MatType, AccumulateWeighted, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_8UC1, CV_32FC1) | ||
) | ||
) | ||
#else | ||
PERF_TEST_P( Size_MatType, AccumulateWeighted, | ||
testing::Combine( | ||
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p), | ||
testing::Values(CV_32FC1) | ||
) | ||
) | ||
#endif | ||
{ | ||
Size sz = get<0>(GetParam()); | ||
int dstType = get<1>(GetParam()); | ||
|
||
Mat src(sz, CV_8UC1); | ||
Mat dst(sz, dstType); | ||
|
||
declare.time(100); | ||
declare.in(src, WARMUP_RNG).out(dst); | ||
|
||
TEST_CYCLE() accumulateWeighted(src, dst, 0.314); | ||
|
||
SANITY_CHECK(dst); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters