Commit Graph

35278 Commits

Author SHA1 Message Date
Abhishek Gola
3891d32f58 triangle weights bug fixed and ldr ground truth updated 2025-06-02 16:06:11 +05:30
Kumataro
cd0699a338
Merge pull request #27384 from Kumataro:fix27382
imgcodecs: jpegxl: support lossless compression #27384

Close https://github.com/opencv/opencv/issues/27382

### 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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-02 11:23:38 +03:00
Maxim Smolskiy
e92cfb35f6
Merge pull request #27389 from MaximSmolskiy:add_HoughCirclesWithAccumulator_binding
Add HoughCirclesWithAccumulator binding #27389

### Pull Request Readiness Checklist

Fix #27377 

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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-02 10:23:17 +03:00
Alexander Smorkalov
a39f61b6e1
Merge pull request #27390 from MaximSmolskiy:update_HoughLinesWithAccumulator_binding
Update HoughLinesWithAccumulator binding
2025-06-02 09:41:33 +03:00
MaximSmolskiy
e1f6e85c88 Update HoughLinesWithAccumulator binding 2025-06-01 19:19:21 +03:00
Alexander Smorkalov
b3cb517cac
Merge pull request #27385 from CodeLinaro:doc_update
Updating doc markdown to include API in FastCV gemm HAL
2025-05-30 15:24:15 +03:00
Liane Lin
8a0ea789e7
Merge pull request #27149 from liane-lin:4.x
Fix #25696: Solved the problem in Subdiv2D, empty delaunay triangulation #27149

Detailed description

Expected behaviour:
Given 4 points, where no three points are collinear, the Delaunay Triangulation Algorithm should return 2 triangles.

Actual:
The algorithm returns zero triangles in this particular case.

Fix:
The radius of the circumcircle tends to infinity when the points are closer to form collinear points, so the problem occurs because the super-triangles are not large enough,
which then results in certain edges are not swapped. The proposed solution just increases the super triangle, duplicating the value of constant for example.

### 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
- [x] The PR is proposed to the proper branch
- [x] 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
2025-05-30 15:20:01 +03:00
Aditi Sharma
d26aa99a05 Updating doc markdown to include API in FastCV gemm HAL 2025-05-30 17:01:07 +05:30
Alexander Smorkalov
9f7793cdae
Merge pull request #27375 from CodeLinaro:doc_update
Updating doc markdown to include newly added FastCV HAL and Extension…
2025-05-28 16:06:42 +03:00
Aditi Sharma
47d0bedeb2 Updating doc markdown to include newly added FastCV HAL and Extension APIs 2025-05-28 15:43:04 +05:30
Myron Rodrigues
344f8c6400
Merge pull request #27363 from MRo47:openvino-npu-support
Feature: Add OpenVINO NPU support #27363

## Why
- OpenVINO now supports inference on integrated NPU devices in intel's Core Ultra series processors.
- Sometimes as fast as GPU, but should use considerably less power.

## How
- The NPU plugin is now available as "NPU" in openvino `ov::Core::get_available_devices()`.
- Removed the guards and checks for NPU in available targets for Inference Engine backend.

## Test example

### Pre-requisites
- Intel [Core Ultra series processor](https://www.intel.com/content/www/us/en/products/details/processors/core-ultra/edge.html#tab-blade-1-0)
- [Intel NPU driver](https://github.com/intel/linux-npu-driver/releases)
- OpenVINO 2023.3.0+ (Tested on 2025.1.0)

### Example
```cpp
#include <opencv2/dnn.hpp>
#include <iostream>

int main(){
    cv::dnn::Net net = cv::dnn::readNet("../yolov8s-openvino/yolov8s.xml", "../yolov8s-openvino/yolov8s.bin");
    cv::Size net_input_shape = cv::Size(640, 480);
    std::cout << "Setting backend to DNN_BACKEND_INFERENCE_ENGINE and target to DNN_TARGET_NPU" << std::endl;
    net.setPreferableBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE);
    net.setPreferableTarget(cv::dnn::DNN_TARGET_NPU);

    cv::Mat image(net_input_shape, CV_8UC3);
    cv::randu(image, cv::Scalar(0, 0, 0), cv::Scalar(255, 255, 255));
    cv::Mat blob = cv::dnn::blobFromImage(
        image, 1, net_input_shape, cv::Scalar(0, 0, 0), true, false, CV_32F);
    net.setInput(blob);
    std::cout << "Running forward" << std::endl;
    cv::Mat result = net.forward();
    std::cout << "Output shape: " << result.size << std::endl; // Output shape: 1 x 84 x 6300
}
```

model files [here](https://limewire.com/d/bPgiA#BhUeSTBnMc)

docker image used to build opencv: [ghcr.io/mro47/opencv-builder](https://github.com/MRo47/opencv-builder/blob/main/Dockerfile)

Closes #26240

### 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
- [x] The PR is proposed to the proper branch
- [x] 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
2025-05-27 14:13:49 +03:00
Alexander Smorkalov
a23baceb06
Merge pull request #27367 from CodeLinaro:xuezha_markdown
update building_fastcv.markdown
2025-05-27 14:10:36 +03:00
Xue Zhang
17f399f475 update building_fastcv.markdown 2025-05-27 13:34:29 +05:30
Alexander Smorkalov
575e3adc01
Merge pull request #27345 from asmorkalov:as/android_sdk_fastcv
Fixed FastCV linkage in OpenCV4AndroidSDK
2025-05-25 10:13:00 +03:00
Alexander Smorkalov
7578007d23
Merge pull request #27356 from asmorkalov:as/ipp_hal_copyright
Added default copyright header to IPP HAL
2025-05-24 18:54:27 +03:00
Alexander Smorkalov
0806124ac7 Try to add FastCV to OpenCV4AndroidSDK 2025-05-24 18:49:11 +03:00
Alexander Smorkalov
b4944c9375 Added default copyright header to IPP HAL. 2025-05-24 16:57:49 +03:00
Alexander Smorkalov
0a5352ee27
Merge pull request #27346 from asmorkalov:as/ipp_hal_sum
New HAL entry for cv::sum and IPP adoption
2025-05-24 16:53:42 +03:00
Myron Rodrigues
374ad41420
Merge pull request #27353 from MRo47:fix/segfault-on-forward#27352
Fix #27352: Add checks before getting latest pin in Net::Impl::getLatestLayerPin() #27353 

### Pull Request Readiness Checklist

Fixes #27352 

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
- [x] The PR is proposed to the proper branch
- [x] 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
2025-05-24 10:07:45 +03:00
Maxim Smolskiy
023d14ecc4
Merge pull request #27347 from MaximSmolskiy:improve-solveCubic-accuracy
Improve solveCubic accuracy #27347

### Pull Request Readiness Checklist

Fix #27323 

```
2e-13 * x^3 + x^2 - 2 * x + 1 = 0 -> x^3 + 5e12 * x^2 - 1e13 * x + 5e12 = 0
```

The problem that coefficients have quite big magnitudes and current calculations are subject to round-off error

```
Q = (a1 * a1 - 3 * a2) * (1./9)
R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) * (1./54)
Qcubed = Q * Q * Q = a1^6/729 - (a1^4 a2)/81 + (a1^2 a2^2)/27 - a2^3/27
R * R = R^2 = a1^6/729 - (a1^4 a2)/81 + (a1^2 a2^2)/36 + (a1^3 a3)/27 - (a1 a2 a3)/6 + a3^2/4
d = Qcubed - R * R
```

Let `a1`, `a2`, `a3` have quite big same magnitudes, then we see that `Qcubed` and `R * R` have same terms `a1^6/729` and `-(a1^4 a2)/81` (which will be reduced in `d`), but they level out the other terms (these terms have `6`th and `5`th degree and other terms - less or equal than `4`th degree).
So, if these terms will participate in the calculation, this will lead to a huge round-off error.
But if we expand the expression, then round-off error should be less
```
d = Qcubed - R * R = 1/108 (a1^2 a2^2 - 4 a2^3 - 4 a1^3 a3 + 18 a1 a2 a3 - 27 a3^2)
```

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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-05-24 09:56:48 +03:00
Alexander Smorkalov
388b6dd81f New HAL entry for cv::sum and IPP adoption. 2025-05-23 12:35:11 +03:00
Alexander Smorkalov
b8099d3cc2
Merge pull request #27348 from fengyuentau:4x/hal/riscv_rvv/faster_div_f32
hal/riscv-rvv: further optimize div
2025-05-23 11:31:16 +03:00
Alexander Smorkalov
5a457842f1
Merge pull request #27351 from mshabunin:fix-intrin-legacy-ops-2
core: legacy intrin operators - fixed version warning condition
2025-05-23 07:50:39 +03:00
Maksim Shabunin
e6fb6c290c core: legacy intrin operators - fixed version warning condition 2025-05-22 21:00:49 +03:00
Yuantao Feng
2c4eab0969 perf: speed up vfdiv by Newton-Raphson routine 2025-05-22 12:58:40 +08:00
Alexander Smorkalov
aee828ac6e
Merge pull request #27344 from asmorkalov:as/kleidicv_no_cv_namespace
Disabled cv namespace usage inside KleidiCV.
2025-05-21 16:13:48 +03:00
Yuantao Feng
c37f54aeed
Merge pull request #27343 from fengyuentau:4x/build/fix_more_warnings
build: fix more warnings from recent gcc versions after #27337 #27343

More fixings after https://github.com/opencv/opencv/pull/27337

### 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
- [x] 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
2025-05-21 16:12:09 +03:00
Alexander Smorkalov
7ecb1d8cab Disabled cv namespace usage inside KleidiCV. 2025-05-21 13:04:23 +03:00
omahs
0bc95d9256
Merge pull request #27338 from omahs:patch-1
Fix typos #27338

### 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
- [x] 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
2025-05-21 12:13:50 +03:00
Alexander Smorkalov
dc610867e1
Merge pull request #27342 from MaximSmolskiy:fix-bug-in-solvePoly-test
Fix bug in solvePoly test
2025-05-21 11:19:01 +03:00
Alexander Smorkalov
5177c4a25a
Merge pull request #27341 from dkurt:vit_ov_test
Higher threshold for ViT on OpenVINO
2025-05-21 11:00:52 +03:00
Alexander Smorkalov
4530206445
Merge pull request #27340 from asmorkalov:apreetam_5thPost
Update hash for the fastcv libs for both Linux and Android #27340

Replaces https://github.com/opencv/opencv/pull/27290
Updated libs PR: https://github.com/opencv/opencv_3rdparty/pull/95

### 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
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-05-21 10:24:13 +03:00
MaximSmolskiy
d4c4493413 Fix bug in solvePoly test 2025-05-21 09:31:43 +03:00
Dmitry Kurtaev
3ff6c7f9fe
Higher threshold for ViT on OpenVINO 2025-05-21 09:31:40 +03:00
Yuantao Feng
166f76d224
Merge pull request #27337 from fengyuentau:4x/build/riscv/fix_warnings
build: fix warnings from recent gcc versions #27337

This PR addresses the following found warnings:
- [x] -Wmaybe-uninitialized
- [x] -Wunused-variable
- [x] -Wsign-compare

Tested building with GCC 14.2 (RISC-V 64).

### 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
- [x] 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
2025-05-21 09:28:29 +03:00
Gursimar Singh
c3fe92d813
Merge pull request #27270 from gursimarsingh:bug_fix_unstable_crf
Bug fix unstable crf #27270

### 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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake

The PR resolves the issue for triangle Weights used by debevec algorithm being non zero at extremes. 
It resolves #24966 

The fix needs ground truth data to be changed in order to pass existing tests. PR to opencv_extra: https://github.com/opencv/opencv_extra/pull/1253
2025-05-21 08:40:11 +03:00
Maxim Smolskiy
d00738d97c
Merge pull request #27331 from MaximSmolskiy:add-test-for-solveCubic
Add tests for solveCubic #27331

### Pull Request Readiness Checklist

Related to #27323 

I found only randomized tests with number of roots always equal to `1` or `3`, `x^3 = 0` and some simple test for Java and Swift.
Obviously, they don't cover all cases (implementation has strong branching and number of roots can be equal to `-1`, `0` and `2` additionally).
So, I think it will be useful to try explicitly cover more cases (and implementation branches correspondingly)

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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-05-21 08:36:35 +03:00
Alexander Smorkalov
79a5e5276a
Merge pull request #27334 from fengyuentau:4x/imgproc/compareHist_chisqr_simd
imgproc: vectorize mode CHISQR and CHISQR_ALT in compareHist
2025-05-21 07:07:57 +03:00
Yuantao Feng
9b08167769
hal/imgproc: add hal for calcHist and implement in hal:riscv-rvv (#27332)
hal/imgproc: add hal for calcHist and implement in hal/riscv-rvv #27332

### 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
- [x] 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
2025-05-21 07:07:22 +03:00
Alexander Smorkalov
23f8e523a0
Merge pull request #27325 from VadimLevin/dev:vlevin/header-parser-conditional-inclusion-directives-handling
feat: add conditional inclusion support to header parser
2025-05-20 18:11:12 +03:00
Yuantao Feng
7fe8ce19d9 perf: vectorize mode CHISQR and CHISQR_ALT in compareHist 2025-05-19 17:09:33 +08:00
Dmitry Kurtaev
1e3ab44cff
Merge pull request #27307 from dkurt:tflite_face_blendshape_model
TFLite fixes for Face Blendshapes V2 #27307

### Pull Request Readiness Checklist

* Scalars support
* Better handling of 1D tensors
* New ops import: SUB, SQRT, DIV, NEG, SQUARED_DIFFERENCE, SUM
* Number of NHWC<->NCHW layouts compatibility improvements

resolves #27211

**Merge with extra**: https://github.com/opencv/opencv_extra/pull/1257

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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-05-19 10:45:18 +03:00
Vadim Levin
b3e17ea9d4 feat: add conditional inclusion support to header parser 2025-05-19 10:11:52 +03:00
Alexander Smorkalov
eae77dae86
Merge pull request #27327 from mshabunin:fix-intrin-legacy-ops
Restored legacy intrinsics operators in a separate header
2025-05-19 09:19:35 +03:00
Alexander Smorkalov
9d2d927fa9
Merge pull request #27326 from dkurt:handle_multi_output_eltwise_fusion
CUDA: Handle fusion of conv+eltwise in case of multi-output node (i.e. Split)
2025-05-19 09:12:38 +03:00
Madan mohan Manokar
84ea77a4be
Merge pull request #27299 from amd:fast_medianblur_simd
imgproc: medianblur: Performance improvement #27299

* Bottleneck in non-vectorized path reduced.
* AVX512 dispatch added for medianblur.

### 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
- [x] 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
2025-05-19 08:56:57 +03:00
Maksim Shabunin
a9b298eb47 Restored legacy intrinsics operators in a separate header 2025-05-17 16:44:07 +03:00
Dmitry Kurtaev
fd5b33bb00 Handle fusion of conv+eltwise in case of multi-output node (i.e. Split) 2025-05-17 11:31:01 +03:00
chengolivia
250b5003ee
Merge pull request #27305 from chengolivia:add-check-sgbm-nondeterminism
Add image dimension check to avoid StereoSGBM non-determinism #27305 
 
Addresses #25828 

Users noticed that StereoSGBM would occasionally give non-deterministic results for `.compute(imgL, imgR)`.

I and others traced the cause to out-of-bounds access that was not being caught when the input images were not wide enough for the input block size and number of disparities to StereoSGBM. The specific math and logic can be found in the above issue's discussion.

This PR adds a CV_Check to make sure images are wider than 1/2 of the block size + the max disparity the algorithm will search.

The check was only added to the regular `compute` method for StereoSGBM and not to the other modes, as I did not observe the non-deterministic behavior with the other compute modes like HH.

In addition, this PR adds a test case to Calib3d to make sure the check is being thrown in the problem case and that the results are deterministic in the good case.

### 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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] 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
2025-05-17 10:19:09 +03:00
Vincent Rabaud
9201ca1af1
Merge pull request #27321 from vrabaud:norm
Make sure to not access outside normDiffTabMake sure to not access outside normDiffTab #27321 

If the norm is outside the array (e.g. Hamming), memory is read outside of the array, which does not matter because the invalid pointer is not used oustide of the function (e.g. the Hamming path is taken) but it triggers the sanitizer.

### 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
- [x] 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
2025-05-17 09:59:08 +03:00