mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-20 12:55:15 +08:00
Merge pull request #3824 from CodeLinaro:FastcvHAL_1stPost
Depends on https://github.com/opencv/opencv/pull/26316 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
44
modules/fastcv/perf/perf_hough.cpp
Normal file
44
modules/fastcv/perf/perf_hough.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "perf_precomp.hpp"
|
||||
|
||||
namespace opencv_test {
|
||||
|
||||
typedef std::tuple<std::string /* file name */, double /* threshold */ > HoughLinesPerfParams;
|
||||
typedef perf::TestBaseWithParam<HoughLinesPerfParams> HoughLinesPerfTest;
|
||||
|
||||
PERF_TEST_P(HoughLinesPerfTest, run,
|
||||
::testing::Combine(::testing::Values("cv/shared/pic5.png",
|
||||
"stitching/a1.png",
|
||||
"cv/shared/pic5.png",
|
||||
"cv/shared/pic1.png"), // images
|
||||
::testing::Values(0.05, 0.25, 0.5, 0.75, 5) // threshold
|
||||
)
|
||||
)
|
||||
{
|
||||
auto p = GetParam();
|
||||
std::string fname = std::get<0>(p);
|
||||
double threshold = std::get<1>(p);
|
||||
|
||||
cv::Mat src = imread(cvtest::findDataFile(fname), cv::IMREAD_GRAYSCALE);
|
||||
// make it aligned by 8
|
||||
cv::Mat withBorder;
|
||||
int bpix = ((src.cols & 0xfffffff8) + 8) - src.cols;
|
||||
cv::copyMakeBorder(src, withBorder, 0, 0, 0, bpix, BORDER_REFLECT101);
|
||||
src = withBorder;
|
||||
|
||||
while(next())
|
||||
{
|
||||
std::vector<cv::Vec4f> lines;
|
||||
startTimer();
|
||||
cv::fastcv::houghLines(src, lines, threshold);
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
}
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user