mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
Open Source Computer Vision Library
opencv.org
Add RISC-V HAL implementation for cv::cvtColor #27007 This patch implements the following functions in RVV_HAL using native intrinsics, optimizing the performance of `cv::cvtColor` for all possible data types and modes (except for `COLOR_Bayer`, `COLOR_YUV2GRAY_420` and `COLOR_mRGBA`, as these modes have no HAL interface): ``` cv_hal_cvtBGRtoBGR cv_hal_cvtBGRtoBGR5x5 cv_hal_cvtBGR5x5toBGR cv_hal_cvtBGRtoGray cv_hal_cvtGraytoBGR cv_hal_cvtBGR5x5toGray cv_hal_cvtGraytoBGR5x5 cv_hal_cvtBGRtoYUV cv_hal_cvtYUVtoBGR cv_hal_cvtBGRtoXYZ cv_hal_cvtXYZtoBGR cv_hal_cvtBGRtoHSV cv_hal_cvtHSVtoBGR cv_hal_cvtBGRtoLab cv_hal_cvtLabtoBGR cv_hal_cvtTwoPlaneYUVtoBGR cv_hal_cvtBGRtoTwoPlaneYUV cv_hal_cvtThreePlaneYUVtoBGR cv_hal_cvtBGRtoThreePlaneYUV cv_hal_cvtOnePlaneYUVtoBGR cv_hal_cvtOnePlaneBGRtoYUV ``` Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0. ``` $ ./opencv_test_imgproc --gtest_filter="*Color*-*Bayer*" $ ./opencv_perf_imgproc --gtest_filter="*Color*-*Bayer*" --gtest_also_run_disabled_tests --perf_min_samples=100 --perf_force_samples=100 ``` View the full perf table here: [hal_rvv_color.pdf](https://github.com/user-attachments/files/19055417/hal_rvv_color.pdf) ### 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 |
||
|---|---|---|
| .github | ||
| 3rdparty | ||
| apps | ||
| cmake | ||
| data | ||
| doc | ||
| include | ||
| modules | ||
| platforms | ||
| samples | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| COPYRIGHT | ||
| LICENSE | ||
| README.md | ||
| SECURITY.md | ||
OpenCV: Open Source Computer Vision Library
Resources
- Homepage: https://opencv.org
- Courses: https://opencv.org/courses
- Docs: https://docs.opencv.org/4.x/
- Q&A forum: https://forum.opencv.org
- previous forum (read only): http://answers.opencv.org
- Issue tracking: https://github.com/opencv/opencv/issues
- Additional OpenCV functionality: https://github.com/opencv/opencv_contrib
- Donate to OpenCV: https://opencv.org/support/
Contributing
Please read the contribution guidelines before starting work on a pull request.
Summary of the guidelines:
- One pull request per issue;
- Choose the right base branch;
- Include tests and documentation;
- Clean up "oops" commits before submitting;
- Follow the coding style guide.
Additional Resources
- Submit your OpenCV-based project for inclusion in Community Friday on opencv.org
- Subscribe to the OpenCV YouTube Channel featuring OpenCV Live, an hour-long streaming show
- Follow OpenCV on LinkedIn for daily posts showing the state-of-the-art in computer vision & AI
- Apply to be an OpenCV Volunteer to help organize events and online campaigns as well as amplify them
- Follow OpenCV on Mastodon in the Fediverse
- Follow OpenCV on Twitter
- OpenCV.ai: Computer Vision and AI development services from the OpenCV team.