nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #26915: imgcodecs: fix PNG read on BE platforms (s390x) - Resolves #26913 Related(?): #25715 #26832

**Code Changes:**
```diff
@@ -121,16 +121,16 @@
 namespace cv
 {
 
-const uint32_t id_IHDR = 0x52444849; // PNG header
-const uint32_t id_acTL = 0x4C546361; // Animation control chunk
-const uint32_t id_fcTL = 0x4C546366; // Frame control chunk
-const uint32_t id_IDAT = 0x54414449; // first frame and/or default image
-const uint32_t id_fdAT = 0x54416466; // Frame data chunk
-const uint32_t id_PLTE = 0x45544C50; // The PLTE chunk contains a color palette for indexed-color images
```

Review comment:
Actually the proper way is to use: ``` const uint32_t id = png_get_uint_32(size_d + 4); ```
**File:** modules/calib3d/src/fundam.cpp
**Change Type:** modified
**Context:** PR #26921: Fix assertion in cv2.sampsonDistance

**Code Changes:**
```diff
@@ -1224,7 +1224,7 @@ double cv::sampsonDistance(InputArray _pt1, InputArray _pt2, InputArray _F)
 {
     CV_INSTRUMENT_REGION();
 
-    CV_Assert(_pt1.type() == CV_64F && _pt2.type() == CV_64F && _F.type() == CV_64F);
+    CV_Assert(_pt1.depth() == CV_64F && _pt2.depth() == CV_64F && _F.depth() == CV_64F);
     CV_DbgAssert(_pt1.rows() == 3 && _F.size() == Size(3, 3) && _pt1.rows() == _pt2.rows());
 
     Mat pt1(_pt1.getMat());
```

Review comment:
Please use Mat::depth() instead of bit magic: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a8da9f853b6f3a29d738572fd1ffc44c0
**File:** modules/imgcodecs/src/grfmt_gif.hpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method

**Code Changes:**
```diff
@@ -11,14 +11,35 @@
 namespace cv
 {
 
-enum GifOpMode
-{
-    GRFMT_GIF_Nothing = 0,
-    GRFMT_GIF_PreviousImage = 1,
-    GRFMT_GIF_Background = 2,
-    GRFMT_GIF_Cover = 3
```

Review comment:
consider using enum GifDisposeMethod { GIF_DISPOSE_NA = 0, GIF_DISPOSE_NONE = 1, GIF_DISPOSE_RESTORE_BACKGROUND = 2, GIF_DISPOSE_RESTORE_PREVIOUS = 3, };
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method

**Code Changes:**
```diff
@@ -24,7 +24,6 @@ GifDecoder::GifDecoder() {
     hasRead = false;
     hasTransparentColor = false;
     transparentColor = 0;
-    opMode = GRFMT_GIF_Nothing;
     top = 0, left = 0, width = 0, height = 0;
     depth = 8;
     idx = 0;
@@ -66,6 +65,8 @@ bool GifDecoder::readHeader() {
         for (int i = 0; i < 3 * globalColorTableSize; i++) {
```

Review comment:
`uchar flag = GifDisposeMethod::GIF_DISPOSE_RESTORE_PREVIOUS << 2;`
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method

**Code Changes:**
```diff
@@ -24,7 +24,6 @@ GifDecoder::GifDecoder() {
     hasRead = false;
     hasTransparentColor = false;
     transparentColor = 0;
-    opMode = GRFMT_GIF_Nothing;
     top = 0, left = 0, width = 0, height = 0;
     depth = 8;
     idx = 0;
@@ -66,6 +65,8 @@ bool GifDecoder::readHeader() {
         for (int i = 0; i < 3 * globalColorTableSize; i++) {
```

Review comment:
I'm sorry I changed it to use new enum, but I missed to use restoreToPrevious method. I fixed it.
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method

**Code Changes:**
```diff
@@ -24,7 +24,6 @@ GifDecoder::GifDecoder() {
     hasRead = false;
     hasTransparentColor = false;
     transparentColor = 0;
-    opMode = GRFMT_GIF_Nothing;
     top = 0, left = 0, width = 0, height = 0;
     depth = 8;
     idx = 0;
@@ -66,6 +65,8 @@ bool GifDecoder::readHeader() {
         for (int i = 0; i < 3 * globalColorTableSize; i++) {
```

Review comment:
M.b. stupid question: why do you use flag values 0,1,2, and then shift left / shift right them during IO? The flag values may be shifted here once. Also please replace & 0x3 with some meaningful constant name like `GIF_DISPOSE_FLAG_MASK`.
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method

**Code Changes:**
```diff
@@ -24,7 +24,6 @@ GifDecoder::GifDecoder() {
     hasRead = false;
     hasTransparentColor = false;
     transparentColor = 0;
-    opMode = GRFMT_GIF_Nothing;
     top = 0, left = 0, width = 0, height = 0;
     depth = 8;
     idx = 0;
@@ -66,6 +65,8 @@ bool GifDecoder::readHeader() {
         for (int i = 0; i < 3 * globalColorTableSize; i++) {
```

Review comment:
The out-of-bound check looks strange. Need to check if it's possible and it's not a bug/broken input. We should not silently ignore input issues.
**File:** modules/imgcodecs/test/test_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method
**Review Line:** 373

**Code Changes:**
```diff
 
+// See https://github.com/opencv/opencv/issues/26924
+TEST(Imgcodecs_Gif, decode_disposal_method)
+{
+    const string root = cvtest::TS::ptr()->get_data_path();
+    const string filename = root + "gifsuite/disposalMethod.gif";
+    cv::Animation anim;
+    bool ret = false;
+    EXPECT_NO_THROW(ret = imreadanimation(filename, anim, cv::IMREAD_UNCHANGED));
+    EXPECT_TRUE(ret);
+
```

Review comment:
Looks like it's a new file. Please create PR to opencv_extra repo with the same branch name.
**File:** modules/imgcodecs/test/test_gif.cpp
**Change Type:** modified
**Context:** PR #26930: imgcodecs: gif: support Disposal Method
**Review Line:** 373

**Code Changes:**
```diff
 
+// See https://github.com/opencv/opencv/issues/26924
+TEST(Imgcodecs_Gif, decode_disposal_method)
+{
+    const string root = cvtest::TS::ptr()->get_data_path();
+    const string filename = root + "gifsuite/disposalMethod.gif";
+    cv::Animation anim;
+    bool ret = false;
+    EXPECT_NO_THROW(ret = imreadanimation(filename, anim, cv::IMREAD_UNCHANGED));
+    EXPECT_TRUE(ret);
+
```

Review comment:
I'm sorry I created branch which has same name this patch so its test is passed, but I forget to create PR. Please could you merge this pull request ? https://github.com/opencv/opencv_extra/pull/1239
**File:** modules/features2d/test/test_fast.cpp
**Change Type:** modified
**Context:** PR #26907: Migrate remaning OpenVX integrations to OpenVX HAL (features2d)

**Code Changes:**
```diff
@@ -118,8 +118,8 @@ void CV_FastTest::run( int )
     read( fs["exp_kps2"], exp_kps2, Mat() );
     fs.release();
 
-     if ( exp_kps1.size != kps1.size || 0 != cvtest::norm(exp_kps1, kps1, NORM_L2) ||
-          exp_kps2.size != kps2.size || 0 != cvtest::norm(exp_kps2, kps2, NORM_L2))
+    if ( exp_kps1.size != kps1.size || 0 != cvtest::norm(exp_kps1, kps1, NORM_L2) ||
+         exp_kps2.size != kps2.size || 0 != cvtest::norm(exp_kps2, kps2, NORM_L2))
     {
         ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
```

Review comment:
Maybe `ASSERT_TRUE` would be better in this case? Here and on line 163 (`ASSERT_GT`).
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc
**Review Line:** 3990

**Code Changes:**
```diff
@@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input
     return k.run(2, globalThreads, NULL, false);
 }
 
-#if 0
-/**
-@deprecated with old version of cv::linearPolar
-*/
-static bool ocl_linearPolar(InputArray _src, OutputArray _dst,
-    Point2f center, double maxRadius, int flags)
-{
-    UMat src_with_border; // don't scope this variable (it holds image data)
-
-    UMat mapx, mapy, r, cp_sp;
-    UMat src = _src.getUMat();
```

Review comment:
Please presume the API in 4.x, but remove in 5.x. Backward compatibility is important.
**File:** modules/imgproc/test/test_imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc
**Review Line:** 1116

**Code Changes:**
```diff
@@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak)
     }
 }
 
-//** @deprecated */
-TEST(Imgproc_linearPolar, identity)
-{
-    const int N = 33;
-    Mat in(N, N, CV_8UC3, Scalar(255, 0, 0));
-    in(cv::Rect(N/3, N/3, N/3, N/3)).setTo(Scalar::all(255));
-    cv::blur(in, in, Size(5, 5));
-    cv::blur(in, in, Size(5, 5));
-
-    Mat src = in.clone();
-    Mat dst;
```

Review comment:
I propose to not remove test till the API is there in 4.x.
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc
**Review Line:** 3990

**Code Changes:**
```diff
@@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input
     return k.run(2, globalThreads, NULL, false);
 }
 
-#if 0
-/**
-@deprecated with old version of cv::linearPolar
-*/
-static bool ocl_linearPolar(InputArray _src, OutputArray _dst,
-    Point2f center, double maxRadius, int flags)
-{
-    UMat src_with_border; // don't scope this variable (it holds image data)
-
-    UMat mapx, mapy, r, cp_sp;
-    UMat src = _src.getUMat();
```

Review comment:
I closed the PR in the `4.x` branch of OpenCV (#26909) and made the relevant changes in the `5.x` branch. I hope that's fine.
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc
**Review Line:** 3990

**Code Changes:**
```diff
@@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input
     return k.run(2, globalThreads, NULL, false);
 }
 
-#if 0
-/**
-@deprecated with old version of cv::linearPolar
-*/
-static bool ocl_linearPolar(InputArray _src, OutputArray _dst,
-    Point2f center, double maxRadius, int flags)
-{
-    UMat src_with_border; // don't scope this variable (it holds image data)
-
-    UMat mapx, mapy, r, cp_sp;
-    UMat src = _src.getUMat();
```

Review comment:
Please remove the function from header file too.
**File:** modules/imgproc/test/test_imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc

**Code Changes:**
```diff
@@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak)
     }
 }
 
-//** @deprecated */
-TEST(Imgproc_linearPolar, identity)
-{
-    const int N = 33;
-    Mat in(N, N, CV_8UC3, Scalar(255, 0, 0));
-    in(cv::Rect(N/3, N/3, N/3, N/3)).setTo(Scalar::all(255));
```

Review comment:
The test should be either removed or updated to call `warpPolar`.
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc
**Review Line:** 1467

**Code Changes:**
```diff
@@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input
     return k.run(2, globalThreads, NULL, false);
 }
 
-#if 0
-/**
-@deprecated with old version of cv::linearPolar
-*/
-static bool ocl_linearPolar(InputArray _src, OutputArray _dst,
-    Point2f center, double maxRadius, int flags)
-{
-    UMat src_with_border; // don't scope this variable (it holds image data)
-
-    UMat mapx, mapy, r, cp_sp;
-    UMat src = _src.getUMat();
```

Review comment:
Corresponding `*.cl` files should be removed too.
**File:** modules/imgproc/test/test_imgwarp.cpp
**Change Type:** modified
**Context:** PR #26914: removal of deprecated functions in imgproc

**Code Changes:**
```diff
@@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak)
     }
 }
 
-//** @deprecated */
-TEST(Imgproc_linearPolar, identity)
-{
-    const int N = 33;
-    Mat in(N, N, CV_8UC3, Scalar(255, 0, 0));
-    in(cv::Rect(N/3, N/3, N/3, N/3)).setTo(Scalar::all(255));
```

Review comment:
There is Imgproc_warpPolar.identity test. It implements the same procedure, but with the new API. So, the test may be removed without coverage loss.
**File:** modules/video/misc/java/test/TrackerCreateTest.java
**Change Type:** modified
**Context:** PR #26875: Added trackers factory with pre-loaded dnn models
**Review Line:** 63

**Code Changes:**
```diff
     public void testCreateTrackerGOTURN() {
+        Net net;
+        try {
+            String protoFile = new File(testDataPath, "dnn/gsoc2016-goturn/goturn.prototxt").toString();
+            String weightsFile = new File(modelsDataPath, "dnn/gsoc2016-goturn/goturn.caffemodel").toString();
+            net = Dnn.readNetFromCaffe(protoFile, weightsFile);
+        } catch (CvException e) {
+            return;
+        }
+        Tracker tracker = TrackerGOTURN.create(net);
+        assert(tracker != null);
```

Review comment:
GOTURN files can be located in separate folders - weights in OPENCV_DNN_TEST_DATA_PATH, prototxt in OPENCV_TEST_DATA_PATH.
**File:** modules/video/misc/java/test/TrackerCreateTest.java
**Change Type:** modified
**Context:** PR #26875: Added trackers factory with pre-loaded dnn models
**Review Line:** 65

**Code Changes:**
```diff
+        try {
+            String protoFile = new File(testDataPath, "dnn/gsoc2016-goturn/goturn.prototxt").toString();
+            String weightsFile = new File(modelsDataPath, "dnn/gsoc2016-goturn/goturn.caffemodel").toString();
+            net = Dnn.readNetFromCaffe(protoFile, weightsFile);
+        } catch (CvException e) {
+            return;
+        }
+        Tracker tracker = TrackerGOTURN.create(net);
+        assert(tracker != null);
+    }
+
```

Review comment:
Maybe `throw new TestSkipException();`?
**File:** modules/video/misc/java/test/TrackerCreateTest.java
**Change Type:** modified
**Context:** PR #26875: Added trackers factory with pre-loaded dnn models
**Review Line:** 63

**Code Changes:**
```diff
     public void testCreateTrackerGOTURN() {
+        Net net;
+        try {
+            String protoFile = new File(testDataPath, "dnn/gsoc2016-goturn/goturn.prototxt").toString();
+            String weightsFile = new File(modelsDataPath, "dnn/gsoc2016-goturn/goturn.caffemodel").toString();
+            net = Dnn.readNetFromCaffe(protoFile, weightsFile);
+        } catch (CvException e) {
+            return;
+        }
+        Tracker tracker = TrackerGOTURN.create(net);
+        assert(tracker != null);
```

Review comment:
I fixed data search logic and introduced `modelsDataPath` to find files correctly.
**File:** cmake/OpenCVFindLibsPerf.cmake
**Change Type:** modified
**Context:** PR #26917: Switch to static instance of FastCV

**Code Changes:**
```diff
@@ -181,7 +181,14 @@ endif(WITH_KLEIDICV)
 if(WITH_FASTCV)
   if((EXISTS ${FastCV_INCLUDE_PATH}) AND (EXISTS ${FastCV_LIB_PATH}))
     message(STATUS "Use external FastCV ${FastCV_INCLUDE_PATH}, ${FastCV_LIB_PATH}")
-    set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status")
+    find_library(FASTCV_LIBRARY NAMES "fastcv"
+                 PATHS "${FastCV_LIB_PATH}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    mark_as_advanced(FASTCV_LIBRARY)
+    if (FASTCV_LIBRARY)
+      set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status")
```

Review comment:
I believe we don't need special `NOTFOUND` handling - it should be built into the `if` [command](https://cmake.org/cmake/help/latest/command/if.html): > True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number (including floating point numbers). False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND.
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26883: Remove code duplication from test for FileStorage Base64

**Code Changes:**
```diff
@@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo
         {   /* init */
 
             /* a normal mat u8 */
-            _2d_out_u8 = cv::Mat(10, 20, CV_8UC3, cv::Scalar(1U, 2U, 127U));
-            for (int i = 0; i < _2d_out_u8.rows; ++i)
-                for (int j = 0; j < _2d_out_u8.cols; ++j)
-                    _2d_out_u8.at<cv::Vec3b>(i, j)[1] = (i + j) % 256;
+            _2d_out_u8 = Mat(10, 20, CV_8UC3);
+            cv::randu(_2d_out_u8, 0U, 255U);
```

Review comment:
`EXPECT_MAT_NEAR(_2d_in_u8, _2d_out_u8, 0)` or `EXPECT_MAT_N_DIFF(_2d_in_u8, _2d_out_u8, 0)` or `EXPECT_PRED_FORMAT2(cvtest::MatComparator(0, 0), _2d_in_u8, _2d_out_u8);` should be enough here. The in and out matrices should be bit exact, right?
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26883: Remove code duplication from test for FileStorage Base64

**Code Changes:**
```diff
@@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo
         {   /* init */
 
             /* a normal mat u8 */
-            _2d_out_u8 = cv::Mat(10, 20, CV_8UC3, cv::Scalar(1U, 2U, 127U));
-            for (int i = 0; i < _2d_out_u8.rows; ++i)
-                for (int j = 0; j < _2d_out_u8.cols; ++j)
-                    _2d_out_u8.at<cv::Vec3b>(i, j)[1] = (i + j) % 256;
+            _2d_out_u8 = Mat(10, 20, CV_8UC3);
+            cv::randu(_2d_out_u8, 0U, 255U);
```

Review comment:
it may be replaced with cv::randu output, right?
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26883: Remove code duplication from test for FileStorage Base64

**Code Changes:**
```diff
@@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo
         {   /* init */
 
             /* a normal mat u8 */
-            _2d_out_u8 = cv::Mat(10, 20, CV_8UC3, cv::Scalar(1U, 2U, 127U));
-            for (int i = 0; i < _2d_out_u8.rows; ++i)
-                for (int j = 0; j < _2d_out_u8.cols; ++j)
-                    _2d_out_u8.at<cv::Vec3b>(i, j)[1] = (i + j) % 256;
+            _2d_out_u8 = Mat(10, 20, CV_8UC3);
+            cv::randu(_2d_out_u8, 0U, 255U);
```

Review comment:
Extra function is not needed at all: ``` cv::Mat _2d_out_u8(rows, cols, type, scalar); // scalar is not needed here most probably cv::randu(_2d_out_u8, min, max); ```` See https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp
**Change Type:** added
**Context:** PR #26884: [HAL] split8u RVV 1.0

**Code Changes:**
```diff
@@ -0,0 +1,93 @@
+// 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.
+#ifndef OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+#define OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+
+#include <riscv_vector.h>
+
+namespace cv { namespace cv_hal_rvv {
```

Review comment:
Is it for particular version of Clang?
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp
**Change Type:** added
**Context:** PR #26884: [HAL] split8u RVV 1.0

**Code Changes:**
```diff
@@ -0,0 +1,93 @@
+// 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.
+#ifndef OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+#define OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+
+#include <riscv_vector.h>
+
+namespace cv { namespace cv_hal_rvv {
```

Review comment:
The same question
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp
**Change Type:** added
**Context:** PR #26884: [HAL] split8u RVV 1.0

**Code Changes:**
```diff
@@ -0,0 +1,93 @@
+// 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.
+#ifndef OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+#define OPENCV_HAL_RVV_SPLIT_HPP_INCLUDED
+
+#include <riscv_vector.h>
+
+namespace cv { namespace cv_hal_rvv {
```

Review comment:
idk i copied it from merge.hpp
**File:** modules/core/src/mean.dispatch.cpp
**Change Type:** modified
**Context:** PR #26895: Use HAL for cv::mean function too

**Code Changes:**
```diff
@@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask)
     CV_Assert( mask.empty() || mask.type() == CV_8U );
 
     int k, cn = src.channels(), depth = src.depth();
-    Scalar s;
+    Scalar s = Scalar::all(0.0);
+
+    CV_Assert( cn <= 4 );
 
     CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_mean(src, mask, s), s)
```

Review comment:
Is it possible to use CALL_HAL_RET macro here and below?
**File:** modules/core/src/mean.dispatch.cpp
**Change Type:** modified
**Context:** PR #26895: Use HAL for cv::mean function too

**Code Changes:**
```diff
@@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask)
     CV_Assert( mask.empty() || mask.type() == CV_8U );
 
     int k, cn = src.channels(), depth = src.depth();
-    Scalar s;
+    Scalar s = Scalar::all(0.0);
+
+    CV_Assert( cn <= 4 );
 
     CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_mean(src, mask, s), s)
```

Review comment:
The macro expects, that the return value is the last HAL function parameter. It's not applicable here.
**File:** modules/core/src/mean.dispatch.cpp
**Change Type:** modified
**Context:** PR #26895: Use HAL for cv::mean function too

**Code Changes:**
```diff
@@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask)
     CV_Assert( mask.empty() || mask.type() == CV_8U );
 
     int k, cn = src.channels(), depth = src.depth();
-    Scalar s;
+    Scalar s = Scalar::all(0.0);
+
+    CV_Assert( cn <= 4 );
 
     CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_mean(src, mask, s), s)
```

Review comment:
Perhaps we should add a new macro which doesn't pass `retval` to HAL function: ```.cpp // name TBD #define CALL_HAL_RET2(name, fun, retval, ...) \ int res = __CV_EXPAND(fun(__VA_ARGS__)); \ if (res == CV_HAL_ERROR_OK) \ return retval; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ CV_Error_(cv::Error::StsInternal, \ ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); ``` Then old macros could be redefined as follows: ```.cpp #define CALL_HAL_RET(name, fun, retval, ...) \ CALL_HAL_RET2(name, fun, retval, __VA_ARGS__, &retval) #define CALL_HAL(name, fun, ...) \ CALL_HAL_RET2(name, fun, ,__VA_ARGS__) ```
**File:** modules/core/src/mean.dispatch.cpp
**Change Type:** modified
**Context:** PR #26895: Use HAL for cv::mean function too
**Review Line:** 139

**Code Changes:**
```diff
+
+    CV_Assert( cn <= 4 );
 
     CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_mean(src, mask, s), s)
 
+    if (src.isContinuous() && mask.isContinuous())
+    {
+        CALL_HAL_RET2(meanStdDev, cv_hal_meanStdDev, s, src.data, 0, (int)src.total(), 1, src.type(),
+                      &s[0], nullptr /*stddev*/, mask.data, 0);
+    }
+    else
```

Review comment:
Usually we put HAL call before IPP.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/atan.hpp
**Change Type:** added
**Context:** PR #26853: Add RISC-V HAL implementation for fastAtan32f/fastAtan64f
**Review Line:** 19

**Code Changes:**
```diff
+#include <cfloat>
+
+namespace cv::cv_hal_rvv {
+
+namespace detail {
+// ref: mathfuncs_core.simd.hpp
+static constexpr float pi = CV_PI;
+static constexpr float atan2_p1 = 0.9997878412794807F * (180 / pi);
+static constexpr float atan2_p3 = -0.3258083974640975F * (180 / pi);
+static constexpr float atan2_p5 = 0.1555786518463281F * (180 / pi);
+static constexpr float atan2_p7 = -0.04432655554792128F * (180 / pi);
```

Review comment:
Could you add reference to the computation method, name, formula, whatever to identify the approach? Constants meaning and other arithmetic details will be more obvious with such details.