Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add RISC-V HAL implementation for cv::pyrDown and cv::pyrUp#26958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asmorkalov merged 7 commits intoopencv:4.xfromamane-ame:pyramids_hal_rvv
Mar 4, 2025

Conversation

@amane-ame
Copy link
Contributor

This patch implementscv_hal_pyrdown/cv_hal_pyrup function in RVV_HAL using native intrinsics, optimizing the performance forcv::pyrDown,cv::pyrUp andcv::buildPyramids with data types{8U,16S,32F} x {C1,C2,C3,C4,Cn}.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

$ ./opencv_test_imgproc --gtest_filter="*pyr*:*Pyr*"$ ./opencv_perf_imgproc --gtest_filter="*pyr*:*Pyr*" --perf_min_samples=300 --perf_force_samples=300
Untitled

Pull Request Readiness Checklist

See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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

amane-ameand others added5 commitsFebruary 16, 2025 16:11
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
@asmorkalov
Copy link
Contributor

Please rebase and fix conflicts.

Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
@asmorkalov
Copy link
Contributor

Perf numbers for Spacemit Muse Pi v 30 (GCC 14.2):

pyrDown::Size_MatType::(127x61, 8UC1) 0.018 0.018 1.01pyrDown::Size_MatType::(127x61, 16SC1) 0.022 0.018 1.17pyrDown::Size_MatType::(127x61, 32FC1) 0.019 0.019 1.00pyrDown::Size_MatType::(127x61, 8UC3) 0.065 0.031 2.14pyrDown::Size_MatType::(127x61, 16SC3) 0.070 0.032 2.16pyrDown::Size_MatType::(127x61, 32FC3) 0.065 0.035 1.83pyrDown::Size_MatType::(127x61, 8UC4) 0.042 0.036 1.17pyrDown::Size_MatType::(127x61, 16SC4) 0.069 0.040 1.73pyrDown::Size_MatType::(127x61, 32FC4) 0.065 0.042 1.56pyrDown::Size_MatType::(320x240, 8UC1) 0.058 0.051 1.14pyrDown::Size_MatType::(320x240, 16SC1) 0.063 0.055 1.14pyrDown::Size_MatType::(320x240, 32FC1) 0.064 0.064 0.99pyrDown::Size_MatType::(320x240, 8UC3) 0.456 0.138 3.31pyrDown::Size_MatType::(320x240, 16SC3) 0.440 0.156 2.82pyrDown::Size_MatType::(320x240, 32FC3) 0.382 0.166 2.29pyrDown::Size_MatType::(320x240, 8UC4) 0.237 0.185 1.28pyrDown::Size_MatType::(320x240, 16SC4) 0.438 0.202 2.16pyrDown::Size_MatType::(320x240, 32FC4) 0.400 0.265 1.51pyrDown::Size_MatType::(640x480, 8UC1) 0.180 0.156 1.16pyrDown::Size_MatType::(640x480, 16SC1) 0.181 0.162 1.12pyrDown::Size_MatType::(640x480, 32FC1) 0.222 0.225 0.98pyrDown::Size_MatType::(640x480, 8UC3) 1.770 0.558 3.17pyrDown::Size_MatType::(640x480, 16SC3) 1.762 0.721 2.44pyrDown::Size_MatType::(640x480, 32FC3) 1.631 1.021 1.60pyrDown::Size_MatType::(640x480, 8UC4) 0.948 0.824 1.15pyrDown::Size_MatType::(640x480, 16SC4) 1.830 0.996 1.84pyrDown::Size_MatType::(640x480, 32FC4) 1.833 1.413 1.30pyrDown::Size_MatType::(1280x720, 8UC1) 0.495 0.437 1.13pyrDown::Size_MatType::(1280x720, 16SC1) 0.563 0.497 1.13pyrDown::Size_MatType::(1280x720, 32FC1) 0.829 0.819 1.01pyrDown::Size_MatType::(1280x720, 8UC3) 5.462 1.609 3.40pyrDown::Size_MatType::(1280x720, 16SC3) 5.252 2.294 2.29pyrDown::Size_MatType::(1280x720, 32FC3) 4.644 3.274 1.42pyrDown::Size_MatType::(1280x720, 8UC4) 2.970 2.415 1.23pyrDown::Size_MatType::(1280x720, 16SC4) 5.621 3.238 1.74pyrDown::Size_MatType::(1280x720, 32FC4) 6.236 5.073 1.23pyrDown::Size_MatType::(1920x1080, 8UC1) 2.271 1.961 1.16pyrDown::Size_MatType::(1920x1080, 16SC1) 1.466 1.352 1.08pyrDown::Size_MatType::(1920x1080, 32FC1) 2.026 2.068 0.98pyrDown::Size_MatType::(1920x1080, 8UC3) 13.350 3.836 3.48pyrDown::Size_MatType::(1920x1080, 16SC3) 12.742 5.957 2.14pyrDown::Size_MatType::(1920x1080, 32FC3) 10.460 8.651 1.21pyrDown::Size_MatType::(1920x1080, 8UC4) 8.920 6.165 1.45pyrDown::Size_MatType::(1920x1080, 16SC4) 14.579 9.148 1.59pyrDown::Size_MatType::(1920x1080, 32FC4) 16.442 13.892 1.18pyrUp::Size_MatType::(127x61, 8UC1) 0.124 0.074 1.68pyrUp::Size_MatType::(127x61, 16SC1) 0.119 0.077 1.55pyrUp::Size_MatType::(127x61, 32FC1) 0.134 0.141 0.95pyrUp::Size_MatType::(127x61, 8UC3) 0.363 0.221 1.64pyrUp::Size_MatType::(127x61, 16SC3) 0.362 0.243 1.49pyrUp::Size_MatType::(127x61, 32FC3) 0.519 0.473 1.10pyrUp::Size_MatType::(127x61, 8UC4) 0.493 0.288 1.71pyrUp::Size_MatType::(127x61, 16SC4) 0.506 0.346 1.46pyrUp::Size_MatType::(127x61, 32FC4) 0.934 0.511 1.83pyrUp::Size_MatType::(320x240, 8UC1) 1.109 0.807 1.37pyrUp::Size_MatType::(320x240, 16SC1) 1.013 0.648 1.56pyrUp::Size_MatType::(320x240, 32FC1) 1.093 0.559 1.96pyrUp::Size_MatType::(320x240, 8UC3) 3.553 3.017 1.18pyrUp::Size_MatType::(320x240, 16SC3) 3.342 2.397 1.39pyrUp::Size_MatType::(320x240, 32FC3) 3.911 2.302 1.70pyrUp::Size_MatType::(320x240, 8UC4) 5.381 3.562 1.51pyrUp::Size_MatType::(320x240, 16SC4) 4.493 3.174 1.42pyrUp::Size_MatType::(320x240, 32FC4) 5.149 3.185 1.62pyrUp::Size_MatType::(640x480, 8UC1) 4.442 3.892 1.14pyrUp::Size_MatType::(640x480, 16SC1) 4.107 2.861 1.44pyrUp::Size_MatType::(640x480, 32FC1) 4.654 2.863 1.63pyrUp::Size_MatType::(640x480, 8UC3) 15.506 11.783 1.32pyrUp::Size_MatType::(640x480, 16SC3) 13.772 9.141 1.51pyrUp::Size_MatType::(640x480, 32FC3) 15.384 9.701 1.59pyrUp::Size_MatType::(640x480, 8UC4) 20.438 13.956 1.46pyrUp::Size_MatType::(640x480, 16SC4) 19.403 13.898 1.40pyrUp::Size_MatType::(640x480, 32FC4) 22.509 14.574 1.54pyrUp::Size_MatType::(1280x720, 8UC1) 15.634 11.194 1.40pyrUp::Size_MatType::(1280x720, 16SC1) 13.798 9.824 1.40pyrUp::Size_MatType::(1280x720, 32FC1) 16.698 10.182 1.64pyrUp::Size_MatType::(1280x720, 8UC3) 45.080 32.759 1.38pyrUp::Size_MatType::(1280x720, 16SC3) 40.116 29.394 1.36pyrUp::Size_MatType::(1280x720, 32FC3) 45.339 31.277 1.45pyrUp::Size_MatType::(1280x720, 8UC4) 58.486 41.172 1.42pyrUp::Size_MatType::(1280x720, 16SC4) 58.284 40.594 1.44pyrUp::Size_MatType::(1280x720, 32FC4) 67.617 41.300 1.64
amane-ame reacted with eyes emoji

@fengyuentau
Copy link
Member

My perf on K1 (clang) and RK3568:
pyrUp-pyrDown-perf.zip

@asmorkalovasmorkalov merged commitcbcfd77 intoopencv:4.xMar 4, 2025
27 of 28 checks passed
@asmorkalovasmorkalov mentioned this pull requestMar 11, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovasmorkalov approved these changes

@mshabuninmshabuninmshabunin approved these changes

@fengyuentaufengyuentaufengyuentau approved these changes

Assignees

@asmorkalovasmorkalov

Projects

None yet

Milestone

4.12.0

Development

Successfully merging this pull request may close these issues.

4 participants

@amane-ame@asmorkalov@fengyuentau@mshabunin

[8]ページ先頭

©2009-2025 Movatter.jp