mirror of
https://github.com/opencv/opencv.git
synced 2026-12-03 05:33:03 -06:00
683d4a5bb1ac7ce7983b6f4cbf1db5665c252c2d
The SIMD kernels of cv::norm(src, NORM_L2/NORM_L2SQR) for CV_16S and CV_32S sum adjacent squares in a type that is too narrow for the most negative value: - CV_16S: the int16 dot product accumulates pairs in int32, and (-32768)^2 + (-32768)^2 = 2^31 wraps to INT_MIN. - CV_32S: the int32 dot product accumulates pairs in int64, and INT_MIN^2 + INT_MIN^2 = 2^63 wraps to INT64_MIN. As a result NORM_L2SQR could return a negative value and NORM_L2 NaN, but only for inputs long enough to reach the vector loop. Masked norm and norm(src1, src2) were not affected. Widen the int16 pairwise sums as unsigned (they always fit into uint32) and square int32 values in double. Performance is unchanged.
OpenCV: Open Source Computer Vision Library
Resources
- Homepage: https://opencv.org
- Courses: https://opencv.org/courses
- Docs: https://docs.opencv.org/5.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 X
- OpenCV.ai: Computer Vision and AI development services from the OpenCV team.
Description
Languages
C++
87.7%
C
3.1%
Python
2.9%
CMake
2%
Java
1.5%
Other
2.6%