nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25624: HAL added for add(array, scalar)
**Review Line:** 113

**Code Changes:**
```diff
+@param dst_step destination image step
+@param width width of the images
+@param height height of the images
+@param scalar_data pointer to scalar value
+*/
+inline int hal_ni_addScalar32f32f(const float *src_data, size_t src_step, float *dst_data, size_t dst_step, int width, int height, const float* scalar_data) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_addScalar16s16s(const int16_t *src_data, size_t src_step, int16_t *dst_data, size_t dst_step, int width, int height, const int16_t* scalar_data) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
 //! @}
 
 /**
@@ -192,6 +206,8 @@ inline int hal_ni_not8u(const uchar *src_data, size_t src_step, uchar *dst_data,
```

Review comment:
if we want to support C1, C3 etc. scalars, we need to add `int nchannels` (check that the name is consistent with other HAL entries)
**File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25624: HAL added for add(array, scalar)
**Review Line:** 113

**Code Changes:**
```diff
+@param dst_step destination image step
+@param width width of the images
+@param height height of the images
+@param scalar_data pointer to scalar value
+*/
+inline int hal_ni_addScalar32f32f(const float *src_data, size_t src_step, float *dst_data, size_t dst_step, int width, int height, const float* scalar_data) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_addScalar16s16s(const int16_t *src_data, size_t src_step, int16_t *dst_data, size_t dst_step, int width, int height, const int16_t* scalar_data) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
 //! @}
 
 /**
@@ -192,6 +206,8 @@ inline int hal_ni_not8u(const uchar *src_data, size_t src_step, uchar *dst_data,
```

Review comment:
Probably we will add support for more channels in later PRs For now we leave it just for 1 channel
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26303: Skip KleidiCV in offline build

**Code Changes:**
```diff
@@ -935,7 +935,7 @@ if(HAVE_OPENVX)
   endif()
 endif()
 
-if(WITH_KLEIDICV)
+if(HAVE_KLEIDICV)
   ocv_debug_message(STATUS "Enable KleidiCV acceleration")
   if(NOT ";${OpenCV_HAL};" MATCHES ";kleidicv;")
     set(OpenCV_HAL "kleidicv;${OpenCV_HAL}")
```

Review comment:
This skips `add_subdirectory()` call if user specifies `cmake -DOpenCV_HAL=kleidicv ...`.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26303: Skip KleidiCV in offline build

**Code Changes:**
```diff
@@ -935,7 +935,7 @@ if(HAVE_OPENVX)
   endif()
 endif()
 
-if(WITH_KLEIDICV)
+if(HAVE_KLEIDICV)
   ocv_debug_message(STATUS "Enable KleidiCV acceleration")
   if(NOT ";${OpenCV_HAL};" MATCHES ";kleidicv;")
     set(OpenCV_HAL "kleidicv;${OpenCV_HAL}")
```

Review comment:
What is the problem to follow carotene design?
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26420: Support 0d/1d Mat in FileStorage
**Review Line:** 2054

**Code Changes:**
```diff
+    EXPECT_EQ(src.size, dst.size);
+    EXPECT_EQ(cv::norm(src, dst, NORM_INF), 0.0);
+}
+
+typedef testing::TestWithParam<const char*> FileStorage_exact_type;
+TEST_P(FileStorage_exact_type, empty_mat)
+{
+    testExactMat(Mat(), GetParam());
+}
+
+TEST_P(FileStorage_exact_type, mat_0d)
```

Review comment:
This test raises debug assertion ``` [ RUN ] Core_InputOutput/FileStorage_exact_type.empty_mat/0, where GetParam() = ".yml" unknown file: Failure C++ exception with description "OpenCV(5.0.0-pre) /work/opencv/modules/core/include/opencv2/core/mat.inl.hpp:1349: error: (-215:Assertion failed) i < dims() in function 'operator[]' " thrown in the test body. [ FAILED ] Core_InputOutput/FileStorage_exact_type.empty_mat/0, where GetParam() = ".yml" (1 ms) ``` Here: https://github.com/opencv/opencv/blob/979428d5908b5396237b18cbd50d0b18265e2463/modules/core/include/opencv2/core/mat.inl.hpp#L1346-L1354
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26420: Support 0d/1d Mat in FileStorage
**Review Line:** 2054

**Code Changes:**
```diff
+    EXPECT_EQ(src.size, dst.size);
+    EXPECT_EQ(cv::norm(src, dst, NORM_INF), 0.0);
+}
+
+typedef testing::TestWithParam<const char*> FileStorage_exact_type;
+TEST_P(FileStorage_exact_type, empty_mat)
+{
+    testExactMat(Mat(), GetParam());
+}
+
+TEST_P(FileStorage_exact_type, mat_0d)
```

Review comment:
Please take a look at https://github.com/opencv/opencv/pull/26444
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
AFAIK these kind of functions were keeped in 4.x for compatibility as discussed in https://github.com/opencv/opencv/pull/26259
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
Currently, this is only used internally, it is not part of the public C API (which does not have much in calib3d, cf https://github.com/opencv/opencv/blob/4.x/modules/calib3d/include/opencv2/calib3d/calib3d_c.h). This PR switches the C code that uses it to C++, so there is no need for that function anymore.
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
for example https://github.com/shimat/opencvsharp uses cvUndistortPoints. shouldn't this be preserved?
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
``` git grep cvUndistortPoints ``` dies not return anything in their repo, where do they use it? They use `cv::undistortPoints` which is the C++ API. `modules/calib3d/src/calib3d_c_api.h` is an internal header so modifying it fine, other projects cannot use the API it offers.
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
sorry let me check again
**File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511

**Code Changes:**
```diff
-    cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
-                              cv::TermCriteria(cv::TermCriteria::COUNT, 5, 0.01));
-}
-
 namespace cv {
 
 void undistortPoints(InputArray _src, OutputArray _dst,
```

Review comment:
I agree, the C API is till used, but the API removed in this PR is INTERNAL to OpenCV, nobody outside of OpenCV is using it because they cannot use it: the header that declares it is not public, it is in `src`, not in `include`. `cvUndistortPoints` was removed from the public C API 6 years ago in https://github.com/opencv/opencv/commit/8f15a609afc3c08ea0a5561ca26f1cf182414ca2#diff-7ae6742689a7ee66932275c29e27989687a7b9e6ca2549a765f5b27414c753daR53 The link you just sent me is from a different repo, the last commit on that file is "[support 2.4.10](https://github.com/imclab/opencvsharp/commit/f55344d7c5d93838206c9a55153be4636fa99734)" which is a very old OpenCV that is not supported anymore.
**File:** cmake/OpenCVMinDepVersions.cmake
**Change Type:** modified
**Context:** PR #26287: build: transition to C++17, minor changes in documentation - * Raise C++ standard to C++17 * Show warnings for possible configuration issue...
**Review Line:** 3

**Code Changes:**
```diff
@@ -1,5 +1,6 @@
 if(NOT DEFINED MIN_VER_CMAKE)
-  set(MIN_VER_CMAKE 3.7)
+  set(MIN_VER_CMAKE 3.13) # Debian 10
+  # set(MIN_VER_CMAKE 3.10) # Visual Studio 2017 15.7
 endif()
 set(MIN_VER_CUDA 6.5)
 set(MIN_VER_CUDNN 7.5)
```

Review comment:
Let's use the lowest possible version.
**File:** cmake/OpenCVDetectCXXCompiler.cmake
**Change Type:** modified
**Context:** PR #26287: build: transition to C++17, minor changes in documentation - * Raise C++ standard to C++17 * Show warnings for possible configuration issue...
**Review Line:** 212

**Code Changes:**
```diff
+  if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
+    set(HAVE_CXX17 ON)
   endif()
 endif()
 
 if(NOT HAVE_CXX11)
-  message(FATAL_ERROR "OpenCV 4.x requires C++11")
+  message(WARNING "OpenCV 5.x requires C++11 support, but it was not detected. Your compilation may fail.")
+endif()
+if(NOT HAVE_CXX17)
+  message(WARNING "OpenCV 5.x requires C++17 support, but it was not detected. Your compilation may fail.")
```

Review comment:
C++11 support is implied by C++17 support - so i presume `HAVE_CXX11` could be removed completely?
**File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x

**Code Changes:**
```diff
@@ -42,7 +42,6 @@
 
 #include "precomp.hpp"
 #include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
 #include "distortion_model.hpp"
 #include "calib3d_c_api.h"
 #include <stdio.h>
@@ -58,1316 +57,7 @@
 
```

Review comment:
`dABdA` and `dABdB` are optional. `cvarrToMat` returns empty Mat if the pointer is nullptr. Empty Mat is not equal to `cv::NoArray()`. You have to check pointers on wrapper side and put `cv::noArray` for optional outputs.
**File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x

**Code Changes:**
```diff
@@ -42,7 +42,6 @@
 
 #include "precomp.hpp"
 #include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
 #include "distortion_model.hpp"
 #include "calib3d_c_api.h"
 #include <stdio.h>
@@ -58,1316 +57,7 @@
 
```

Review comment:
The same for optional params.
**File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x

**Code Changes:**
```diff
@@ -42,7 +42,6 @@
 
 #include "precomp.hpp"
 #include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
 #include "distortion_model.hpp"
 #include "calib3d_c_api.h"
 #include <stdio.h>
@@ -58,1316 +57,7 @@
 
```

Review comment:
I actually removed the function
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 2127

**Code Changes:**
```diff
     std::string platform, deviceName;
     std::vector<std::string> deviceTypes;
 
-    if (!configuration)
-        configuration = getenv("OPENCV_OPENCL_DEVICE");
+    std::string configuration(configuration_);
+    if (configuration.empty())
+        configuration = utils::getConfigurationParameterString("OPENCV_OPENCL_DEVICE");
 
-    if (configuration &&
-            (strcmp(configuration, "disabled") == 0 ||
```

Review comment:
NULL can't be handled
**File:** modules/highgui/src/window.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 665

**Code Changes:**
```diff
@@ -662,7 +662,7 @@ int cv::waitKey(int delay)
     static int use_legacy = -1;
     if (use_legacy < 0)
     {
-        use_legacy = getenv("OPENCV_LEGACY_WAITKEY") != NULL ? 1 : 0;
+        use_legacy = utils::getConfigurationParameterBool("OPENCV_LEGACY_WAITKEY");
     }
     if (use_legacy > 0)
         return code;
```

Review comment:
I propose to drop it in 5.x
**File:** modules/videoio/src/cap_dshow.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 306

**Code Changes:**
```diff
-        const char* s = getenv("OPENCV_DSHOW_DEBUG");
-        gs_verbose = s != NULL && atoi(s) != 0;
-    }
-
-
+    static const bool gs_verbose = utils::getConfigurationParameterBool("OPENCV_DSHOW_DEBUG");
     if (gs_verbose)
     {
         va_list args;
@@ -2982,18 +2974,18 @@ int videoInput::start(int deviceID, videoDevice *VD){
     VD->readyToCapture = true;
```

Review comment:
I propose to use generic logging here with default environment variables.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 932

**Code Changes:**
```diff
     {
-#ifndef NO_GETENV
-        char* debug_option = getenv("OPENCV_FFMPEG_DEBUG");
-        char* level_option = getenv("OPENCV_FFMPEG_LOGLEVEL");
+        const bool debug_option = utils::getConfigurationParameterBool("OPENCV_FFMPEG_DEBUG");
+        std::string level_option = utils::getConfigurationParameterString("OPENCV_FFMPEG_LOGLEVEL");
         int level = AV_LOG_VERBOSE;
-        if (level_option != NULL)
+        if (!level_option.empty())
         {
-            level = atoi(level_option);
```

Review comment:
I propose to use generic logging here with default environment variables.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 539

**Code Changes:**
```diff
@@ -536,6 +536,7 @@ OCV_OPTION(ENABLE_CONFIG_VERIFICATION "Fail build if actual configuration doesn'
 OCV_OPTION(OPENCV_ENABLE_MEMALIGN     "Enable posix_memalign or memalign usage" ON)
 OCV_OPTION(OPENCV_DISABLE_FILESYSTEM_SUPPORT "Disable filesystem support" OFF)
 OCV_OPTION(OPENCV_DISABLE_THREAD_SUPPORT "Build the library without multi-threaded code." OFF)
+OCV_OPTION(OPENCV_DISABLE_ENV_SUPPORT "Disable environment variables access (getenv)" (CMAKE_SYSTEM_NAME MATCHES "Windows(CE|Phone|Store)"))
 OCV_OPTION(OPENCV_SEMIHOSTING         "Build the library for semihosting target (Arm). See https://developer.arm.com/documentation/100863/latest." OFF)
 OCV_OPTION(ENABLE_CUDA_FIRST_CLASS_LANGUAGE "Enable CUDA as a first class language, if enabled dependant projects will need to use CMake >= 3.18" OFF
   VISIBLE_IF (WITH_CUDA AND NOT CMAKE_VERSION VERSION_LESS 3.18)
```

Review comment:
iOS and derivatives?
**File:** modules/highgui/src/window.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 665

**Code Changes:**
```diff
@@ -662,7 +662,7 @@ int cv::waitKey(int delay)
     static int use_legacy = -1;
     if (use_legacy < 0)
     {
-        use_legacy = getenv("OPENCV_LEGACY_WAITKEY") != NULL ? 1 : 0;
+        use_legacy = utils::getConfigurationParameterBool("OPENCV_LEGACY_WAITKEY");
     }
     if (use_legacy > 0)
         return code;
```

Review comment:
OK, but this PR is for 4.x, so we'll need to remove it after these changes make their way to 5.x.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 539

**Code Changes:**
```diff
@@ -536,6 +536,7 @@ OCV_OPTION(ENABLE_CONFIG_VERIFICATION "Fail build if actual configuration doesn'
 OCV_OPTION(OPENCV_ENABLE_MEMALIGN     "Enable posix_memalign or memalign usage" ON)
 OCV_OPTION(OPENCV_DISABLE_FILESYSTEM_SUPPORT "Disable filesystem support" OFF)
 OCV_OPTION(OPENCV_DISABLE_THREAD_SUPPORT "Build the library without multi-threaded code." OFF)
+OCV_OPTION(OPENCV_DISABLE_ENV_SUPPORT "Disable environment variables access (getenv)" (CMAKE_SYSTEM_NAME MATCHES "Windows(CE|Phone|Store)"))
 OCV_OPTION(OPENCV_SEMIHOSTING         "Build the library for semihosting target (Arm). See https://developer.arm.com/documentation/100863/latest." OFF)
 OCV_OPTION(ENABLE_CUDA_FIRST_CLASS_LANGUAGE "Enable CUDA as a first class language, if enabled dependant projects will need to use CMake >= 3.18" OFF
   VISIBLE_IF (WITH_CUDA AND NOT CMAKE_VERSION VERSION_LESS 3.18)
```

Review comment:
I'm not sure, it seems that we have no any specific handling for iOS. Perhaps this platform supports environment variables. If Apple compiler defines `NO_GETENV`, then it would automatically disable our getenv support even if cmake option is turned OFF.
**File:** samples/dnn/segmentation.cpp
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine

**Code Changes:**
```diff
@@ -12,81 +12,176 @@ using namespace cv;
 using namespace std;
 using namespace dnn;
 
+const string about =
+        "Use this script to run semantic segmentation deep learning networks using OpenCV.\n\n"
+        "Firstly, download required models using `download_models.py` (if not already done). Set environment variable OPENCV_DOWNLOAD_CACHE_DIR to specify where models should be downloaded. Also, point OPENCV_SAMPLES_DATA_PATH to opencv/samples/data.\n"
+        "To run:\n"
+        "\t ./example_dnn_classification modelName(e.g. u2netp) --input=$OPENCV_SAMPLES_DATA_PATH/butterfly.jpg (or ignore this argument to use device camera)\n"
+        "Model path can also be specified using --model argument.";
```

Review comment:
Please add fallback to ENGINE_CLASSIC, if device/target is not OCV/CPU.
**File:** samples/dnn/segmentation.cpp
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine

**Code Changes:**
```diff
@@ -12,81 +12,176 @@ using namespace cv;
 using namespace std;
 using namespace dnn;
 
+const string about =
+        "Use this script to run semantic segmentation deep learning networks using OpenCV.\n\n"
+        "Firstly, download required models using `download_models.py` (if not already done). Set environment variable OPENCV_DOWNLOAD_CACHE_DIR to specify where models should be downloaded. Also, point OPENCV_SAMPLES_DATA_PATH to opencv/samples/data.\n"
+        "To run:\n"
+        "\t ./example_dnn_classification modelName(e.g. u2netp) --input=$OPENCV_SAMPLES_DATA_PATH/butterfly.jpg (or ignore this argument to use device camera)\n"
+        "Model path can also be specified using --model argument.";
```

Review comment:
It does not print command line options. The command line parser may add custom test to printMessage with ::about(): https://docs.opencv.org/5.x/d0/d2e/classcv_1_1CommandLineParser.html#a2e11e779047efded23f75d9c5c5dd82e
**File:** samples/dnn/segmentation.py
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine

**Code Changes:**
```diff
@@ -1,140 +1,176 @@
 import cv2 as cv
 import argparse
 import numpy as np
-import sys
 
 from common import *
 
-backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
-            cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
```

Review comment:
The same idea for fallback.
**File:** 3rdparty/ndsrvp/src/bilateralFilter.cpp
**Change Type:** added
**Context:** PR #26364: 3rdparty: NDSRVP - Part 2.1: Filter-Related Functions

**Code Changes:**
```diff
@@ -0,0 +1,270 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "ndsrvp_hal.hpp"
+#include "opencv2/imgproc/hal/interface.h"
+#include "cvutils.hpp"
+
+namespace cv {
```

Review comment:
I propose to return `CV_HAL_ERROR_NOT_IMPLEMENTED` instead of assert. Just in case if some branches are added to main OpenCV.
**File:** 3rdparty/ndsrvp/src/bilateralFilter.cpp
**Change Type:** added
**Context:** PR #26364: 3rdparty: NDSRVP - Part 2.1: Filter-Related Functions

**Code Changes:**
```diff
@@ -0,0 +1,270 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "ndsrvp_hal.hpp"
+#include "opencv2/imgproc/hal/interface.h"
+#include "cvutils.hpp"
+
+namespace cv {
```

Review comment:
lrint behaviour depends on external state defined by `fesetround`. Do you have alternative for it?
**File:** samples/dnn/classification.cpp
**Change Type:** modified
**Context:** PR #26334: Modify DNN Samples to use ENGINE_CLASSIC for Non-Default Back-end or Target

**Code Changes:**
```diff
@@ -143,7 +143,11 @@ int main(int argc, char** argv)
     }
     CV_Assert(!model.empty());
     //! [Read and initialize network]
-    Net net = readNetFromONNX(model);
+    EngineType engine = ENGINE_AUTO;
+    if (backend != "default" || target != "cpu"){
+        engine = ENGINE_CLASSIC;
+    }
+    Net net = readNetFromONNX(model, engine);
```

Review comment:
Let it be `ENGINE_AUTO`. It fails back to classic in case of issues.
**File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26390: Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1
**Review Line:** 23

**Code Changes:**
```diff
@@ -20,4 +20,5 @@ else()
   set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/kleidicv-${KLEIDICV_SRC_COMMIT}")
 endif()
 
+option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
 include("${THE_ROOT}/adapters/opencv/CMakeLists.txt")
```

Review comment:
`if(ANDRROID)` ?
**File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26390: Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1
**Review Line:** 23

**Code Changes:**
```diff
@@ -20,4 +20,5 @@ else()
   set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/kleidicv-${KLEIDICV_SRC_COMMIT}")
 endif()
 
+option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
 include("${THE_ROOT}/adapters/opencv/CMakeLists.txt")
```

Review comment:
It's not specific to Android, it's clang side effect.
**File:** modules/dnn/src/caffe/caffe_importer.cpp
**Change Type:** modified
**Context:** PR #26208: Modified Caffe parser to support the new dnn engine

**Code Changes:**
```diff
@@ -40,6 +40,7 @@
 //M*/
 
 #include "../precomp.hpp"
+#include "../net_impl.hpp"
 
 #ifdef HAVE_PROTOBUF
 #include <iostream>
@@ -53,8 +54,10 @@
 #include "caffe_io.hpp"
```

Review comment:
`const &`?