Skip to content

Move IPP norm and normDiff to HAL#27128

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
asmorkalov:as/ipp_norm
Mar 24, 2025
Merged

Move IPP norm and normDiff to HAL#27128
asmorkalov merged 3 commits intoopencv:4.xfrom
asmorkalov:as/ipp_norm

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Mar 22, 2025

Continues #26880

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

@asmorkalov asmorkalov added category: core category: 3rdparty cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) labels Mar 22, 2025
@asmorkalov asmorkalov added this to the 4.12.0 milestone Mar 22, 2025
@asmorkalov asmorkalov changed the title WIP: IPP HAL for norm and normDiff WIP: Move IPP norm and normDiff to HAL Mar 22, 2025
@asmorkalov asmorkalov changed the title WIP: Move IPP norm and normDiff to HAL Move IPP norm and normDiff to HAL Mar 23, 2025
@asmorkalov asmorkalov merged commit 0944f7a into opencv:4.x Mar 24, 2025
26 of 28 checks passed
@asmorkalov asmorkalov mentioned this pull request Apr 29, 2025
pi-squared pushed a commit to pi-squared/opencv that referenced this pull request May 17, 2025
This commit addresses the performance issue reported in GitHub issue opencv#25928 where
cv2.norm(img1, img2) became significantly slower in versions newer than 4.2.0.34.

The root cause was identified as the change that moved IPP optimizations to the
Hardware Abstraction Layer (HAL) in PR opencv#27128. This architectural change
improved code structure but introduced overhead for this specific case.

Changes include:
- Add direct SIMD-optimized implementations for L1, L2, and INF norms for float matrices
- Add performance tests to verify the improvement
- Add documentation explaining the fix

With this change, cv2.norm(img1, img2) should be faster than the workaround
of using cv2.norm(img1 - img2), which is important for image comparison operations.

Fixes: opencv#25928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core category: 3rdparty cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants