nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #26101: C-API cleanup: moved cvErrorStr to new interface, minor ts changes - Merge with opencv/opencv_contrib#3786 **Note:** `toString` might be to...

**Code Changes:**
```diff
@@ -60,72 +60,6 @@
 namespace cv
 {
 
-//! @addtogroup core_utils
-//! @{
-
-namespace Error {
-//! error codes
-enum Code {
```

Review comment:
`int` -> `Code` at least to enable C++ ADL without explicit namespace.
**File:** modules/ts/src/ts.cpp
**Change Type:** modified
**Context:** PR #26101: C-API cleanup: moved cvErrorStr to new interface, minor ts changes - Merge with opencv/opencv_contrib#3786 **Note:** `toString` might be to...
**Review Line:** 545

**Code Changes:**
```diff
@@ -544,7 +542,7 @@ static int tsErrorCallback( int status, const char* func_name, const char* err_m
 {
     TS* ts = (TS*)data;
     const char* delim = std::string(err_msg).find('\n') == std::string::npos ? "" : "\n";
-    ts->printf(TS::LOG, "OpenCV Error:\n\t%s (%s%s) in %s, file %s, line %d\n", cvErrorStr(status), delim, err_msg, func_name[0] != 0 ? func_name : "unknown function", file_name, line);
+    ts->printf(TS::LOG, "OpenCV Error:\n\t%d (%s%s) in %s, file %s, line %d\n", status, delim, err_msg, func_name[0] != 0 ? func_name : "unknown function", file_name, line);
     return 0;
 }
 
@@ -638,7 +636,6 @@ void TS::update_context( BaseTest* test, int test_case_idx, bool update_ts_conte
     current_test_info.test = test;
```

Review comment:
Note: used numeric code here instead of string
**File:** modules/dnn/src/dnn_utils.cpp
**Change Type:** modified
**Context:** PR #26127: Faster implementation of blobFromImages for cpu nchw output

**Code Changes:**
```diff
@@ -126,6 +126,111 @@ Mat blobFromImagesWithParams(InputArrayOfArrays images, const Image2BlobParams&
     return blob;
 }
 
+template<typename Tinp, typename Tout>
+void blobFromImagesNCHWImpl(const std::vector<Mat>& images, Mat& blob_, const Image2BlobParams& param)
+{
+    int w = images[0].cols;
+    int h = images[0].rows;
+    int wh = w * h;
```

Review comment:
```CV_BadDepth``` -> ```Error::BadDepth```
**File:** modules/dnn/src/dnn_utils.cpp
**Change Type:** modified
**Context:** PR #26127: Faster implementation of blobFromImages for cpu nchw output

**Code Changes:**
```diff
@@ -126,6 +126,111 @@ Mat blobFromImagesWithParams(InputArrayOfArrays images, const Image2BlobParams&
     return blob;
 }
 
+template<typename Tinp, typename Tout>
+void blobFromImagesNCHWImpl(const std::vector<Mat>& images, Mat& blob_, const Image2BlobParams& param)
+{
+    int w = images[0].cols;
+    int h = images[0].rows;
+    int wh = w * h;
```

Review comment:
```CV_StsNotImplemented ``` -> ```Error::StsNotImplemented```
**File:** modules/objdetect/src/qrcode_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder

**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
     else if (pad_num <= 4)
     {
         int payload_size = (int)payload.size();
-        writeDecNumber(0, payload_size, payload);
+        payload.insert(payload.end(), payload_size, 0);
     }
     else
     {
-        writeDecNumber(0, 4, payload);
```

Review comment:
Error should be raise instead of providing of wrong result. Need to modify check on the line 1328 with current `CV_Assert(idx < data.size());`
**File:** modules/objdetect/src/qrcode_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder

**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
     else if (pad_num <= 4)
     {
         int payload_size = (int)payload.size();
-        writeDecNumber(0, payload_size, payload);
+        payload.insert(payload.end(), payload_size, 0);
     }
     else
     {
-        writeDecNumber(0, 4, payload);
```

Review comment:
I propose assert here instead of condition.
**File:** modules/objdetect/src/qrcode_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder

**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
     else if (pad_num <= 4)
     {
         int payload_size = (int)payload.size();
-        writeDecNumber(0, payload_size, payload);
+        payload.insert(payload.end(), payload_size, 0);
     }
     else
     {
-        writeDecNumber(0, 4, payload);
```

Review comment:
Just here is nit enough. `while` loop above has the same issue with buffer access.
**File:** modules/objdetect/src/qrcode_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder

**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
     else if (pad_num <= 4)
     {
         int payload_size = (int)payload.size();
-        writeDecNumber(0, payload_size, payload);
+        payload.insert(payload.end(), payload_size, 0);
     }
     else
     {
-        writeDecNumber(0, 4, payload);
```

Review comment:
If we add assertion here, our tests will fail because there are cases where more bits are being read. We need to fix these cases first.
**File:** modules/videoio/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #25500: V4l default image size
**Review Line:** 1010

**Code Changes:**
```diff
     CV_LOG_DEBUG(NULL, "VIDEOIO(V4L2:" << _deviceName << "): opening...");
     FirstCapture = true;
-    width = DEFAULT_V4L_WIDTH;
-    height = DEFAULT_V4L_HEIGHT;
+    width = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_V4L_DEFAULT_WIDTH", DEFAULT_V4L_WIDTH);
+    height = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_V4L_DEFAULT_HEIGHT", DEFAULT_V4L_HEIGHT);
     width_set = height_set = 0;
     bufferSize = DEFAULT_V4L_BUFFERS;
     fps = DEFAULT_V4L_FPS;
```

Review comment:
What is about `const VideoCaptureParameters& params` approach?
**File:** modules/videoio/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #25500: V4l default image size
**Review Line:** 1010

**Code Changes:**
```diff
     CV_LOG_DEBUG(NULL, "VIDEOIO(V4L2:" << _deviceName << "): opening...");
     FirstCapture = true;
-    width = DEFAULT_V4L_WIDTH;
-    height = DEFAULT_V4L_HEIGHT;
+    width = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_V4L_DEFAULT_WIDTH", DEFAULT_V4L_WIDTH);
+    height = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_V4L_DEFAULT_HEIGHT", DEFAULT_V4L_HEIGHT);
     width_set = height_set = 0;
     bufferSize = DEFAULT_V4L_BUFFERS;
     fps = DEFAULT_V4L_FPS;
```

Review comment:
Unfortunately it won't work. The VideoCaptureParameters parameter is applied only after the fn_createCaptureCamera_ call. Here is the sequence: - The `createCapture` is called with the `VideoCaptureParameters` - The `createCapture` calls the configured `fn_createCaptureCamera_` function of the capture backend (which is `create_V4L_capture_cam in this case`) and after the call is succeeded sets the VideoCaptureParameters. The problem is this is the `create_V4L_capture_cam` which is failed (inside the `CvCaptureCAM_V4L::initCapture` function) so we have no chance to apply the VideoCaptureParameters. At least without major refactoring of entire factory code. Note that the utils::getConfigurationParameter... approach is already used here for the `normalizePropRange` property so the change will not introduce new approaches.
**File:** modules/js/generator/embindgen.py
**Change Type:** modified
**Context:** PR #26147: js: fix enum generation issues
**Review Line:** 942

**Code Changes:**
```diff
                 if ns_name.split('.')[0] != 'cv':
                     continue
+                # TODO CALIB_FIX_FOCAL_LENGTH is defined both in cv:: and cv::fisheye
+                prefix = 'FISHEYE_' if 'fisheye' in ns_name else ''
                 for name, const in sorted(ns.consts.items()):
+                    name = prefix + name
                     # print("Gen consts: ", name, const)
                     self.bindings.append(const_template.substitute(js_name=name, value=const))
 
```

Review comment:
What if use `namespace_prefix_override` solution like for the functions? Namespace is already appended to the function names, if it's not overridden by config. It's less hacky and more obvious.
**File:** modules/js/generator/embindgen.py
**Change Type:** modified
**Context:** PR #26147: js: fix enum generation issues
**Review Line:** 942

**Code Changes:**
```diff
                 if ns_name.split('.')[0] != 'cv':
                     continue
+                # TODO CALIB_FIX_FOCAL_LENGTH is defined both in cv:: and cv::fisheye
+                prefix = 'FISHEYE_' if 'fisheye' in ns_name else ''
                 for name, const in sorted(ns.consts.items()):
+                    name = prefix + name
                     # print("Gen consts: ", name, const)
                     self.bindings.append(const_template.substitute(js_name=name, value=const))
 
```

Review comment:
I guess that would work but I don't know how to use it. Should all the enums be added to https://github.com/opencv/opencv/blob/450e741f8d53ff12b4e194c7762adaefb952555a/modules/js/generator/embindgen.py#L989 ?
**File:** modules/highgui/src/window_cocoa.mm
**Change Type:** modified
**Context:** PR #26625: Cocoa/highgui: fix leak in cvGetWindowRect_COCOA

**Code Changes:**
```diff
@@ -662,14 +662,16 @@ CvRect cvGetWindowRect_COCOA( const char* name )
     {
         CV_ERROR( CV_StsNullPtr, "NULL window" );
     } else {
-        NSRect rect = [window frame];
+        @autoreleasepool {
+            NSRect rect = [window frame];
 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6
-        NSPoint pt = [window convertRectToScreen:rect].origin;
+            NSPoint pt = [window convertRectToScreen:rect].origin;
```

Review comment:
The reason I use autorelease pools directly is to maintain consistent coding style. In this file, all 12 instances of autorelease pool is called directly: https://github.com/opencv/opencv/blob/645fd3dffaa50e0b5dd011720048441986640d7e/modules/highgui/src/window_cocoa.mm#L194 https://github.com/opencv/opencv/blob/645fd3dffaa50e0b5dd011720048441986640d7e/modules/highgui/src/window_cocoa.mm#L211 https://github.com/opencv/opencv/blob/645fd3dffaa50e0b5dd011720048441986640d7e/modules/highgui/src/window_cocoa.mm#L223 ... IMO it would be more appropriate to create a new PR to clean up this file.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26621: FastCV-based HAL for OpenCV acceleration 2ndpost-3

**Code Changes:**
```diff
@@ -992,4 +992,59 @@ int fastcv_hal_cvtBGRtoYUVApprox(
 
     fcvStatus status = FASTCV_SUCCESS;
     CV_HAL_RETURN(status, hal_BGRtoYUVApprox);
+}
+
+int fastcv_hal_canny(
+    const uchar*    src_data,
+    size_t          src_step,
+    uchar*          dst_data,
```

Review comment:
1. Looks like lowThresh and highThresh are redundant. 2. What if, lowThresh=12.999999999? I propose to use check with epsilon.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538

**Code Changes:**
```diff
-                    return status == ACAMERA_OK;
+                    return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SENSOR_SENSITIVITY, sensitivity);
                 }
                 return false;
+            case CAP_PROP_ANDROID_DEVICE_TORCH:
+                flashMode = (value != 0) ? ACAMERA_FLASH_MODE_TORCH : ACAMERA_FLASH_MODE_OFF;
+                if (isOpened()) {
+                    return submitRequest(ACaptureRequest_setEntry_u8, ACAMERA_FLASH_MODE, flashMode);
+                }
+                return true;
             default:
```

Review comment:
There are complains about Samsung devices support here: https://stackoverflow.com/questions/23336907/what-is-the-difference-between-flash-mode-torch-and-flash-mode-on. Could you take a look?
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 777

**Code Changes:**
```diff
+    {
+        ACaptureRequest *request = captureRequest.get();
+
+        return request &&
+               setFn(request, tag, 1, &data) == ACAMERA_OK &&
+               ACameraCaptureSession_setRepeatingRequest(captureSession.get(),
+                                                         GetCaptureCallback(),
+                                                         1, &request, nullptr) == ACAMERA_OK;
+    }
 };
 
```

Review comment:
Why do we need it for every ACaptureRequest_setEntryXXX call?
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 603

**Code Changes:**
```diff
@@ -561,7 +600,7 @@ class AndroidCameraCapture : public IVideoCapture
             return false;
         }
         std::shared_ptr<ACameraMetadata> cameraMetadata = std::shared_ptr<ACameraMetadata>(metadata, deleter_ACameraMetadata);
-        ACameraMetadata_const_entry entry;
+        ACameraMetadata_const_entry entry = {};
         ACameraMetadata_getConstEntry(cameraMetadata.get(), ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &entry);
 
         double bestScore = std::numeric_limits<double>::max();
@@ -594,25 +633,19 @@ class AndroidCameraCapture : public IVideoCapture
         }
```

Review comment:
The change does nothing. Default constructor was called in old version too.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538

**Code Changes:**
```diff
-                    return status == ACAMERA_OK;
+                    return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SENSOR_SENSITIVITY, sensitivity);
                 }
                 return false;
+            case CAP_PROP_ANDROID_DEVICE_TORCH:
+                flashMode = (value != 0) ? ACAMERA_FLASH_MODE_TORCH : ACAMERA_FLASH_MODE_OFF;
+                if (isOpened()) {
+                    return submitRequest(ACaptureRequest_setEntry_u8, ACAMERA_FLASH_MODE, flashMode);
+                }
+                return true;
             default:
```

Review comment:
Hmm, I don't know. My primary test device is a SONY. I will try, if FLASH_MODE_ON will work as well.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 777

**Code Changes:**
```diff
+    {
+        ACaptureRequest *request = captureRequest.get();
+
+        return request &&
+               setFn(request, tag, 1, &data) == ACAMERA_OK &&
+               ACameraCaptureSession_setRepeatingRequest(captureSession.get(),
+                                                         GetCaptureCallback(),
+                                                         1, &request, nullptr) == ACAMERA_OK;
+    }
 };
 
```

Review comment:
Yes. It is not sufficient to update the metadata only. Re-submitting the capture request will make the change effective after the current request has finished.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 603

**Code Changes:**
```diff
@@ -561,7 +600,7 @@ class AndroidCameraCapture : public IVideoCapture
             return false;
         }
         std::shared_ptr<ACameraMetadata> cameraMetadata = std::shared_ptr<ACameraMetadata>(metadata, deleter_ACameraMetadata);
-        ACameraMetadata_const_entry entry;
+        ACameraMetadata_const_entry entry = {};
         ACameraMetadata_getConstEntry(cameraMetadata.get(), ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &entry);
 
         double bestScore = std::numeric_limits<double>::max();
@@ -594,25 +633,19 @@ class AndroidCameraCapture : public IVideoCapture
         }
```

Review comment:
ACameraMetadata_const_entry is a POD and doesn't have a user-declared constructor. So it's uninitialized unless we specify the braces. In this particular case the result of the following call to ACameraMetadata_getConstEntry() is not explicitly checked. Instead we rely on the fact, that the member 'count' is zero in case of an error.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538

**Code Changes:**
```diff
-                    return status == ACAMERA_OK;
+                    return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SENSOR_SENSITIVITY, sensitivity);
                 }
                 return false;
+            case CAP_PROP_ANDROID_DEVICE_TORCH:
+                flashMode = (value != 0) ? ACAMERA_FLASH_MODE_TORCH : ACAMERA_FLASH_MODE_OFF;
+                if (isOpened()) {
+                    return submitRequest(ACaptureRequest_setEntry_u8, ACAMERA_FLASH_MODE, flashMode);
+                }
+                return true;
             default:
```

Review comment:
Just tested torch with Xiaomi Mi 10 and Samsung Galaxy S10. Both works well. Let's ignore it for now.
**File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538

**Code Changes:**
```diff
-                    return status == ACAMERA_OK;
+                    return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SENSOR_SENSITIVITY, sensitivity);
                 }
                 return false;
+            case CAP_PROP_ANDROID_DEVICE_TORCH:
+                flashMode = (value != 0) ? ACAMERA_FLASH_MODE_TORCH : ACAMERA_FLASH_MODE_OFF;
+                if (isOpened()) {
+                    return submitRequest(ACaptureRequest_setEntry_u8, ACAMERA_FLASH_MODE, flashMode);
+                }
+                return true;
             default:
```

Review comment:
According to https://developer.android.com/reference/android/hardware/Camera.Parameters FLASH_MODE_ON is part of the old API. Camera2 has FLASH_MODE_OFF, FLASH_MODE_SINGLE and FLASH_MODE_TORCH only.
**File:** modules/photo/src/seamless_cloning_impl.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Review Line:** 332

**Code Changes:**
```diff
@@ -332,11 +332,13 @@ void Cloning::normalClone(const Mat &destination, const Mat &patch, Mat &binaryM
     switch(flag)
     {
         case NORMAL_CLONE:
+        case NORMAL_CLONE_WIDE:
             arrayProduct(patchGradientX, binaryMaskFloat, patchGradientX);
             arrayProduct(patchGradientY, binaryMaskFloat, patchGradientY);
```

Review comment:
The condition is a bit hacky and depends on enum values. I propose to extend "case:" sentences and/or add explicit conditions to make _ALT branch obvious from the code for reader.
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
The `p` parameter does not have default value like `Point p = Point()`. It means that the point is user provided value. I do not think that we sound handle `Point()`, a.k.a. (0,0) as special case.
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
Let's enumerate flag values here to make obvious for core readers.
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
what about using Point(-1,-1) to centralize as special case ?
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
Why do we need special cases in code? User should provide location, shouldn't he/she?
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
"In issue #15928, the user reports: >>I had: ``` src.shape = 500,500 src_mask = 500,500 dest.shape = 500,500 h, w = src_mask.shape[:2] ``` >>At this point, I didn't see the need for the required argument `p`, as I expected the function to automatically match the mask. However, since `p` is a required argument, I provided `(w//2, h//2)` for `p` (the center of the mask). But instead of aligning the source image (`src`) into the destination (`dest`), the resulting cloning was shifted up to the center of the screen! It seems like there may have been an issue with how the center point was calculated or used. The user expected the function to align the source (src) based on the mask (src_mask) automatically, but instead, the function seemed to shift the cloning to an unexpected location. Perhaps the logic for finding the center point could be improved or made more intuitive to help avoid confusion in such cases. A clearer method of determining the center, or perhaps some additional documentation on how to properly use the p argument, might help facilitate this process."
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
also in the issue the user commented >>I got the expected behaviour by using a rect of thickness 2 ``` h, w = src_mask.shape[:2] # rect of thickness > 1 cv2.rectangle(src_mask,(0,0), (w, h) ,255, 2) # the clone will now aligns from the centre out=cv2.seamlessClone(src, dest, src_mask,(w//2, h//2),flags= cv2.NORMAL_CLONE) ``` a rect of 1 thickness did not work.
**File:** modules/photo/src/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone

**Code Changes:**
```diff
@@ -47,18 +47,17 @@
 using namespace std;
 using namespace cv;
 
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, Size size)
 {
-    Mat mask = _mask.getMat();
     Mat gray;
-    if (mask.channels() > 1)
```

Review comment:
i will revert this idea if you want.