Skip to content

Add RISC-V HAL implementation for cv::equalizeHist#27089

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
amane-ame:hist_hal_rvv
Mar 20, 2025
Merged

Add RISC-V HAL implementation for cv::equalizeHist#27089
asmorkalov merged 1 commit intoopencv:4.xfrom
amane-ame:hist_hal_rvv

Conversation

@amane-ame
Copy link
Copy Markdown
Contributor

This patch implements cv_hal_equalize_hist using native intrinsics, optimizing the performance of cv::equalizeHist.

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

$ ./opencv_test_imgproc --gtest_filter="*Equalize_Hist*"
$ ./opencv_perf_imgproc --gtest_filter="*equalizeHist*" --perf_min_samples=10000 --perf_force_samples=10000

image

Pull Request Readiness Checklist

See details at https://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

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

My perf results for Muse Pi v 30 (gcc 14.2):

 EqualizeHist::OCL_EqualizeHistFixture::640x480 	0.555 	0.356 	1.56
EqualizeHist::OCL_EqualizeHistFixture::1280x720 	1.052 	0.718 	1.46
EqualizeHist::OCL_EqualizeHistFixture::1920x1080 	1.989 	1.656 	1.20
EqualizeHist::OCL_EqualizeHistFixture::3840x2160 	6.827 	6.083 	1.12 
equalizeHist::MatSize::127x61 	0.052 	0.053 	0.97
equalizeHist::MatSize::640x480 	0.546 	0.354 	1.54
equalizeHist::MatSize::1280x720 	1.024 	0.730 	1.40
equalizeHist::MatSize::1920x1080 	1.980 	1.669 	1.19 

@asmorkalov asmorkalov self-assigned this Mar 20, 2025
@asmorkalov asmorkalov merged commit 50072f8 into opencv:4.x Mar 20, 2025
43 of 55 checks passed
@asmorkalov asmorkalov mentioned this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants