nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion

**Code Changes:**
```diff
@@ -1261,6 +1261,16 @@ Mat Mat::reshape(int _cn, const std::vector<int>& _newshape) const
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
```

Review comment:
it's safer to use `m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;` here.
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion

**Code Changes:**
```diff
@@ -1656,6 +1656,12 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
     CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
 }
 
+Mat _OutputArray::reinterpret(int mtype) const
+{
+    mtype = CV_MAT_TYPE(mtype);
+    return getMat().reinterpret(mtype);
+}
+
```

Review comment:
don't silently assume that `obj` is `Mat*`. Do `return getMat().reinterpretType(mtype);` instead
**File:** modules/core/include/opencv2/core/mat.hpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion

**Code Changes:**
```diff
@@ -371,6 +371,7 @@ class CV_EXPORTS _OutputArray : public _InputArray
     void release() const;
     void clear() const;
     void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const;
+    Mat reinterpret( int type ) const;
 
     void assign(const UMat& u) const;
     void assign(const Mat& m) const;
@@ -1322,6 +1323,15 @@ class CV_EXPORTS Mat
      */
```

Review comment:
can we skip `Type` suffix in the name? (`Mat reinterpret(int type) const;`?)
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
Why do we need `CV_MAT_TYPE` operation?
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
I want to retrieve the actual type of the cv::Mat to prevent users from passing incorrect parameters, and then perform an assertion check.
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
Need to start with "bad param" test then. Silent ignoring of invalid input doesn't look good.
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
I had added assert checks `CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));` Surely, I will add test cases, and should I create a new PR to update this issue?
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
It is still not clear why do we need `type = CV_MAT_TYPE(type)` operation: - it is useless for valid MatType (works as no-op). - it silently ignores invalid out-of-range input converting/truncating it to some value (which user may not expect).
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25394: Added reinterpret() method to Mat to convert meta-data without actual data conversion
**Review Line:** 1266

**Code Changes:**
```diff
     return reshape(_cn, (int)_newshape.size(), &_newshape[0]);
 }
 
+Mat Mat::reinterpret(int type) const
+{
+    type = CV_MAT_TYPE(type);
+    CV_Assert(CV_ELEM_SIZE(this->type()) == CV_ELEM_SIZE(type));
+    Mat m = *this;
+    m.flags = (m.flags & ~CV_MAT_TYPE_MASK) | type;
+    m.updateContinuityFlag();
+    return m;
```

Review comment:
My initial thought was that types with the same element size could perform a reinterpret operation, and for any other type, an assert operation would be executed. Your point seems to be: When newtype < this->type, a reinterpret operation (truncate) can also be performed. When newtype > this->type, a new mat (convert) should be created. The CV_MAT_TYPE operation is indeed redundant, as these operations are actually the responsibility of the convertTo function. CV_MAT_TYPE is indeed unnecessary.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/warp.hpp
**Change Type:** added
**Context:** PR #27119: Add RISC-V HAL implementation for cv::warp series

**Code Changes:**
```diff
@@ -0,0 +1,1208 @@
+// 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.
+
+// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
+
+#ifndef OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+#define OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+
```

Review comment:
Why do you use assembly? Assembly injection disappoints compiler, because it cannot apply a lot of optimization solutions. I propose to get rid of it, if it's possible, or at least add a comment why if it's really needed.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/warp.hpp
**Change Type:** added
**Context:** PR #27119: Add RISC-V HAL implementation for cv::warp series

**Code Changes:**
```diff
@@ -0,0 +1,1208 @@
+// 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.
+
+// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
+
+#ifndef OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+#define OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+
```

Review comment:
The same on asm.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/warp.hpp
**Change Type:** added
**Context:** PR #27119: Add RISC-V HAL implementation for cv::warp series

**Code Changes:**
```diff
@@ -0,0 +1,1208 @@
+// 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.
+
+// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
+
+#ifndef OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+#define OPENCV_HAL_RVV_WARP_HPP_INCLUDED
+
```

Review comment:
RVV 1.0 does not provide C interface to rounding down, this asm cannot be avoided.
**File:** modules/core/src/norm.simd.hpp
**Change Type:** modified
**Context:** PR #27068: 5.x merge 4.x: vectorized normDiff

**Code Changes:**
```diff
@@ -11,10 +11,12 @@
 namespace cv {
 
 using NormFunc = int (*)(const uchar*, const uchar*, uchar*, int, int);
+using NormDiffFunc = int (*)(const uchar*, const uchar*, const uchar*, uchar*, int, int);
 
 CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
 
 NormFunc getNormFunc(int normType, int depth);
+NormDiffFunc getNormDiffFunc(int normType, int depth);
```

Review comment:
It needs to be backported to 4.x.
**File:** modules/core/src/norm.simd.hpp
**Change Type:** modified
**Context:** PR #27068: 5.x merge 4.x: vectorized normDiff

**Code Changes:**
```diff
@@ -11,10 +11,12 @@
 namespace cv {
 
 using NormFunc = int (*)(const uchar*, const uchar*, uchar*, int, int);
+using NormDiffFunc = int (*)(const uchar*, const uchar*, const uchar*, uchar*, int, int);
 
 CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
 
 NormFunc getNormFunc(int normType, int depth);
+NormDiffFunc getNormDiffFunc(int normType, int depth);
```

Review comment:
Maybe no. Branch 4.x uses `std::abs(src1[j] - src2[j])` already.
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #27174: More elegant skipping SOLVEPNP_IPPE* methods in non-planar accuracy tests for solvePnP*
**Review Line:** 396

**Code Changes:**
```diff
+                {
+                    cout << "mode: " << printMode(mode) << ", method: " << printMethod(method) << " -> "
+                         << "Skip for non-planar tag object" << endl;
+                    continue;
+                }
+
                 //To get the same input for each methods
                 RNG rngCopy = rng;
                 std::vector<double> vec_errorTrans, vec_errorRot;
@@ -486,15 +497,6 @@ class CV_solvePnP_Test : public CV_solvePnPRansac_Test
 protected:
```

Review comment:
It's even better to throw `SkipTestException`. It's handled by test system.
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #27174: More elegant skipping SOLVEPNP_IPPE* methods in non-planar accuracy tests for solvePnP*
**Review Line:** 396

**Code Changes:**
```diff
+                {
+                    cout << "mode: " << printMode(mode) << ", method: " << printMethod(method) << " -> "
+                         << "Skip for non-planar tag object" << endl;
+                    continue;
+                }
+
                 //To get the same input for each methods
                 RNG rngCopy = rng;
                 std::vector<double> vec_errorTrans, vec_errorRot;
@@ -486,15 +497,6 @@ class CV_solvePnP_Test : public CV_solvePnPRansac_Test
 protected:
```

Review comment:
Here one test is for many methods, so it seems that throwing exception will abort whole test and following methods will not be tested
**File:** modules/objdetect/test/test_arucodetection.cpp
**Change Type:** modified
**Context:** PR #27079: Add test for ArucoDetector::detectMarkers

**Code Changes:**
```diff
@@ -650,6 +650,40 @@ TEST(CV_ArucoDetectMarkers, regression_contour_24220)
     }
 }
 
+TEST(CV_ArucoDetectMarkers, regression_26922)
+{
+    const auto arucoDict = aruco::getPredefinedDictionary(aruco::DICT_4X4_1000);
+    const aruco::GridBoard gridBoard(Size(19, 10), 1, 0.25, arucoDict);
+
+    const Size imageSize(7200, 3825);
```

Review comment:
Please add comment that markers with id 76 and 172 are on border and should not be detected. It's not obvious expectation.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/norm.hpp
**Change Type:** modified
**Context:** PR #27115: core: refactored normDiff in hal_rvv and extended with support of more data types

**Code Changes:**
```diff
@@ -166,7 +166,7 @@ struct NormL1_RVV<uchar, int> {
         for (int i = 0; i < n; i += vl) {
             vl = __riscv_vsetvl_e8m8(n - i);
             auto v = __riscv_vle8_v_u8m8(src + i, vl);
-            s = __riscv_vwredsumu(__riscv_vwredsumu_tu(zero, v, zero, vl), s, vl);
+            s = __riscv_vwredsumu(__riscv_vwredsumu_tu(zero, v, zero, vl), s, __riscv_vsetvlmax_e16m1());
         }
         return __riscv_vmv_x(s);
     }
@@ -181,7 +181,7 @@ struct NormL1_RVV<schar, int> {
```

Review comment:
I propose to add assert for `elem_size_tab[depth]` before usage. Just to highlight issue, if table is not complete or data type is unexpected.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/norm_diff.hpp
**Change Type:** modified
**Context:** PR #27115: core: refactored normDiff in hal_rvv and extended with support of more data types

**Code Changes:**
```diff
@@ -1,606 +1,1216 @@
 // 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.
-
+//
 // Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
+// Copyright (C) 2025, SpaceMIT Inc., all rights reserved.
+// Third party copyrights are property of their respective owners.
 
```

Review comment:
The same proposal with assert elem_size_tab[depth].
**File:** modules/core/src/norm.simd.hpp
**Change Type:** modified
**Context:** PR #27115: core: refactored normDiff in hal_rvv and extended with support of more data types
**Review Line:** 387

**Code Changes:**
```diff
         }
         s = (int)v_reduce_max(v_max(v_max(v_max(r0, r1), r2), r3));
         for (; j < n; j++) {
-            int v = src1[j] - src2[j];
-            s = std::max(s, (int)cv_abs(v));
+            s = std::max(s, (int)std::abs(src1[j] - src2[j]));
         }
         return s;
     }
@@ -415,8 +415,7 @@ struct NormDiffInf_SIMD<schar, int> {
         }
```

Review comment:
cv_abs is "public" function and defined in modules/core/include/opencv2/core/base.hpp. It should be fixed too, in case of overflow. Why do you drop it here?
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/norm.hpp
**Change Type:** modified
**Context:** PR #27115: core: refactored normDiff in hal_rvv and extended with support of more data types

**Code Changes:**
```diff
@@ -166,7 +166,7 @@ struct NormL1_RVV<uchar, int> {
         for (int i = 0; i < n; i += vl) {
             vl = __riscv_vsetvl_e8m8(n - i);
             auto v = __riscv_vle8_v_u8m8(src + i, vl);
-            s = __riscv_vwredsumu(__riscv_vwredsumu_tu(zero, v, zero, vl), s, vl);
+            s = __riscv_vwredsumu(__riscv_vwredsumu_tu(zero, v, zero, vl), s, __riscv_vsetvlmax_e16m1());
         }
         return __riscv_vmv_x(s);
     }
@@ -181,7 +181,7 @@ struct NormL1_RVV<schar, int> {
```

Review comment:
Looks like the assert will be disabled in regular release builds: https://en.cppreference.com/w/cpp/error/assert. Why not just CV_Assert? It's defined in `opencv2/core/base.hpp`
**File:** modules/gapi/src/3rdparty/vasot/src/components/ot/mtt/objects_associator.cpp
**Change Type:** modified
**Context:** PR #26682: Fix null pointer dereference in Tracklet by initializing rgb_feature

**Code Changes:**
```diff
@@ -141,6 +141,12 @@ ObjectsAssociator::ComputeRgbDistance(const std::vector<Detection> &detections,
             if (tracking_per_class_ && (detections[d].class_label != tracklets[t]->label))
                 continue;
 
+             // Check if RGB features are available
+            auto t_rgb_features = tracklets[t]->GetRgbFeatures();
+            if (!t_rgb_features || t_rgb_features->empty()) {
+                continue; // Skip if no RGB features are available
+            }
+
```

Review comment:
Please fix indents
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26880: Initial version of IPP-based HAL for x86 and x86_64 platforms
**Review Line:** 951

**Code Changes:**
```diff
@@ -947,7 +947,15 @@ if(NOT DEFINED OpenCV_HAL)
   set(OpenCV_HAL "OpenCV_HAL")
 endif()
 
+if(HAVE_IPP)
+  ocv_debug_message(STATUS "Enable IPP acceleration")
+  if(NOT ";${OpenCV_HAL};" MATCHES ";ipp;")
+    set(OpenCV_HAL "ipp;${OpenCV_HAL}")
+  endif()
+endif()
+
```

Review comment:
> ocv_debug_message It is not visible by default. Make sense to use regular `message()` for such messages
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26880: Initial version of IPP-based HAL for x86 and x86_64 platforms
**Review Line:** 951

**Code Changes:**
```diff
@@ -947,7 +947,15 @@ if(NOT DEFINED OpenCV_HAL)
   set(OpenCV_HAL "OpenCV_HAL")
 endif()
 
+if(HAVE_IPP)
+  ocv_debug_message(STATUS "Enable IPP acceleration")
+  if(NOT ";${OpenCV_HAL};" MATCHES ";ipp;")
+    set(OpenCV_HAL "ipp;${OpenCV_HAL}")
+  endif()
+endif()
+
```

Review comment:
It's a debug message. IPP is already listed as HAL.
**File:** 3rdparty/hal_rvv/hal_rvv.hpp
**Change Type:** modified
**Context:** PR #27046: Fix RISC-V HAL solve/SVD and BGRtoLab

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 #define OPENCV_HAL_RVV_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #ifndef CV_HAL_RVV_071_ENABLED
 #  if defined(__GNUC__) && __GNUC__ == 10 && __GNUC_MINOR__ == 4 && defined(__THEAD_VERSION__) && defined(__riscv_v) && __riscv_v == 7000
```

Review comment:
`imgproc/include` should be added into include directories in cmake.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/color.hpp
**Change Type:** modified
**Context:** PR #27046: Fix RISC-V HAL solve/SVD and BGRtoLab
**Review Line:** 2320

**Code Changes:**
```diff
+            static constexpr float BGR2XYZ[] =
+            {
+                0.180423f / 0.950456f, 0.357580f / 0.950456f, 0.412453f / 0.950456f,
+                0.072169f            , 0.715160f            , 0.212671f            ,
+                0.950227f / 1.088754f, 0.119193f / 1.088754f, 0.019334f / 1.088754f
+            };
             static constexpr float BGR2XYZ_D65[] =
             {
                 0.180423f, 0.357580f, 0.412453f,
                 0.072169f, 0.715160f, 0.212671f,
                 0.950227f, 0.119193f, 0.019334f
```

Review comment:
it'll be great to add reference to the values origin, if you know where they from.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/color.hpp
**Change Type:** modified
**Context:** PR #27046: Fix RISC-V HAL solve/SVD and BGRtoLab
**Review Line:** 2376

**Code Changes:**
```diff
                     }
                 }
             }
             // tweak
-            static constexpr int error2[] = {32,-1,5246,-1,6662,-1,7837,1,8625,-1,11969,1,15290,1,19142,1,19588,1,21707,-1,22731,-1,24291,-1,25922,-1,27402,-1,28485,-1,29878,-1,32405,-1,36227,1,38265,-1,38296,1,38403,-1,41795,1,41867,1,43796,1,48096,-1,50562,-1,51054,-1,54496,1,55328,-1,56973,-1,58594,1,61568,1,66512,-1,68543,-1,68615,1,70105,-1,70692,-1,74924,1,76336,-1,78781,1,79259,-1,80855,1,81662,1,82290,-1,83208,-1,84370,1,86293,1,87263,-1,87939,-1,89942,-1,90258,-1,92101,-1,92325,-1,95244,-1,97556,1,97758,-1,97769,1,98455,1,104087,-1,106997,-1};
+            static constexpr int error2[] = {37,-1,124,-1,503,-1,4150,1,5548,1,6544,1,6659,1,8625,-1,11704,1,16108,-1,16347,-1,16446,-1,18148,1,19624,-1,22731,-1,23479,1,24001,1,24291,-1,25199,-1,25352,-1,27402,-1,28485,-1,29788,1,29807,-1,32149,-1,33451,-1,33974,-1,38265,-1,38403,-1,41038,-1,41279,1,41824,-1,42856,-1,48096,-1,49201,-1,50562,-1,51054,-1,51550,-1,51821,1,56973,-1,57283,1,62335,-1,67867,-1,70692,-1,71194,-1,71662,1,71815,1,72316,-1,73487,1,75722,-1,75959,1,82290,-1,82868,-1,83208,-1,83534,-1,84217,-1,85793,1,86683,-1,87939,-1,89143,1,90258,-1,91432,-1,92302,1,92325,-1,92572,1,93143,-1,93731,-1,94142,-1,95244,-1,96025,-1,96950,-1,97758,-1,102409,-1,104165,-1};
+            static constexpr int error3[] = {32,-1,5246,-1,6662,-1,7837,1,8625,-1,11969,1,15290,1,19142,1,19588,1,21707,-1,22731,-1,24291,-1,25922,-1,27402,-1,28485,-1,29878,-1,32405,-1,36227,1,38265,-1,38296,1,38403,-1,41795,1,41867,1,43796,1,48096,-1,50562,-1,51054,-1,54496,1,55328,-1,56973,-1,58594,1,61568,1,66512,-1,68543,-1,68615,1,70105,-1,70692,-1,74924,1,76336,-1,78781,1,79259,-1,80855,1,81662,1,82290,-1,83208,-1,84370,1,86293,1,87263,-1,87939,-1,89942,-1,90258,-1,92101,-1,92325,-1,95244,-1,97556,1,97758,-1,97769,1,98455,1,104087,-1,106997,-1};
             for (size_t i = 0; i < sizeof(error2) / sizeof(int); i += 2)
-                RGB2Luvprev[error2[i]] += error2[i + 1];
+                RGB2Labprev[error2[i]] += error2[i + 1];
+            for (size_t i = 0; i < sizeof(error3) / sizeof(int); i += 2)
```

Review comment:
Could you add some comment what the tweak does and why it's needed. The code bellow is very cryptic.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/color.hpp
**Change Type:** modified
**Context:** PR #27046: Fix RISC-V HAL solve/SVD and BGRtoLab

**Code Changes:**
```diff
@@ -36,6 +36,11 @@ namespace color {
         cv::parallel_for_(Range(1, height), ColorInvoker(func, std::forward<Args>(args)...), (width - 1) * height / static_cast<double>(1 << 15));
         return func(0, 1, std::forward<Args>(args)...);
     }
+
+    template<typename T> T rint(T val)
+    {
+        return val - std::remainder(val, 1.0);
+    }
 } // cv::cv_hal_rvv::color
```

Review comment:
FYI: rint behaviour may be changed in run-time with user settings. OpenCV cannot control it. https://en.cppreference.com/w/cpp/numeric/math/rint
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/color.hpp
**Change Type:** modified
**Context:** PR #27046: Fix RISC-V HAL solve/SVD and BGRtoLab
**Review Line:** 2376

**Code Changes:**
```diff
                     }
                 }
             }
             // tweak
-            static constexpr int error2[] = {32,-1,5246,-1,6662,-1,7837,1,8625,-1,11969,1,15290,1,19142,1,19588,1,21707,-1,22731,-1,24291,-1,25922,-1,27402,-1,28485,-1,29878,-1,32405,-1,36227,1,38265,-1,38296,1,38403,-1,41795,1,41867,1,43796,1,48096,-1,50562,-1,51054,-1,54496,1,55328,-1,56973,-1,58594,1,61568,1,66512,-1,68543,-1,68615,1,70105,-1,70692,-1,74924,1,76336,-1,78781,1,79259,-1,80855,1,81662,1,82290,-1,83208,-1,84370,1,86293,1,87263,-1,87939,-1,89942,-1,90258,-1,92101,-1,92325,-1,95244,-1,97556,1,97758,-1,97769,1,98455,1,104087,-1,106997,-1};
+            static constexpr int error2[] = {37,-1,124,-1,503,-1,4150,1,5548,1,6544,1,6659,1,8625,-1,11704,1,16108,-1,16347,-1,16446,-1,18148,1,19624,-1,22731,-1,23479,1,24001,1,24291,-1,25199,-1,25352,-1,27402,-1,28485,-1,29788,1,29807,-1,32149,-1,33451,-1,33974,-1,38265,-1,38403,-1,41038,-1,41279,1,41824,-1,42856,-1,48096,-1,49201,-1,50562,-1,51054,-1,51550,-1,51821,1,56973,-1,57283,1,62335,-1,67867,-1,70692,-1,71194,-1,71662,1,71815,1,72316,-1,73487,1,75722,-1,75959,1,82290,-1,82868,-1,83208,-1,83534,-1,84217,-1,85793,1,86683,-1,87939,-1,89143,1,90258,-1,91432,-1,92302,1,92325,-1,92572,1,93143,-1,93731,-1,94142,-1,95244,-1,96025,-1,96950,-1,97758,-1,102409,-1,104165,-1};
+            static constexpr int error3[] = {32,-1,5246,-1,6662,-1,7837,1,8625,-1,11969,1,15290,1,19142,1,19588,1,21707,-1,22731,-1,24291,-1,25922,-1,27402,-1,28485,-1,29878,-1,32405,-1,36227,1,38265,-1,38296,1,38403,-1,41795,1,41867,1,43796,1,48096,-1,50562,-1,51054,-1,54496,1,55328,-1,56973,-1,58594,1,61568,1,66512,-1,68543,-1,68615,1,70105,-1,70692,-1,74924,1,76336,-1,78781,1,79259,-1,80855,1,81662,1,82290,-1,83208,-1,84370,1,86293,1,87263,-1,87939,-1,89942,-1,90258,-1,92101,-1,92325,-1,95244,-1,97556,1,97758,-1,97769,1,98455,1,104087,-1,106997,-1};
             for (size_t i = 0; i < sizeof(error2) / sizeof(int); i += 2)
-                RGB2Luvprev[error2[i]] += error2[i + 1];
+                RGB2Labprev[error2[i]] += error2[i + 1];
+            for (size_t i = 0; i < sizeof(error3) / sizeof(int); i += 2)
```

Review comment:
There is a comment on line 2248.