nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/test/test_qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -3,6 +3,7 @@
 // of this distribution and at http://opencv.org/license.html.
 
 #include "test_precomp.hpp"
+#include "test_qr_utils.hpp"
 #include "opencv2/imgproc.hpp"
 
 namespace opencv_test { namespace {
@@ -33,6 +34,8 @@ std::string qrcode_images_multiple[] = {
   "5_qrcodes.png", "6_qrcodes.png", "7_qrcodes.png", "8_close_qrcodes.png"
```

Review comment:
removed Ptr
**File:** samples/cpp/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -12,6 +12,7 @@ using namespace cv;
 static int liveQRCodeDetect();
 static int imageQRCodeDetect(const string& in_file);
 
+static bool g_useArucoBased = false;
 static bool g_modeMultiQR = false;
 static bool g_detectOnly = false;
 
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
     const string keys =
```

Review comment:
removed Ptr, added ref
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
removed, added inner class Params
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
added inner class Params and add getter for Params to IOS ignore list
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
added const ref
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
added `explicit `
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
these setters drop CI (Python bindings) Maybe update the setters later?
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
I think that constructor with `params` is simpler than calling the setter. I'm not sure there's a big problem with this constructor.
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 768

**Code Changes:**
```diff
 };
 
-class CV_EXPORTS_W QRCodeDetector
-{
+class CV_EXPORTS_W_SIMPLE QRCodeDetectorBase {
 public:
-    CV_WRAP QRCodeDetector();
-    ~QRCodeDetector();
+    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to "protected" (need to fix bindings first)
+    QRCodeDetectorBase();
 
```

Review comment:
As mentioned on team meetings, we have to follow `dnn:Model` approach. Constructors / destructors / assignment / move operators should be defined explicitly. Also we should not have public default constructor (but we have issue with bindings - deprecation and comment should be on-place).
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
It is better to declare virtual destructor first.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 968

**Code Changes:**
```diff
+
+QRCodeDetectorBase::QRCodeDetectorBase() {}
+
+bool QRCodeDetectorBase::detect(InputArray img, OutputArray points) const {
+    CV_Assert(p);
+    return p->detect(img, points);
+}
+
+std::string QRCodeDetectorBase::decode(InputArray img, InputArray points, OutputArray straight_qrcode) const {
+    CV_Assert(p);
+    return p->decode(img, points, straight_qrcode);
```

Review comment:
> `->` All deference cases must be pre-checked for NULL values.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
> new `makePtr`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
PImpl pattern classes should not have large method implementations. All logic must go to `Impl`.
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
In DNN `pyopencv_cv_dnn_dnn_ClassificationModel_setEnableSoftmaxPostProcessing` has been properly generated.
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
done. The directive `CV_EXPORTS_W_SIMPLE` instead of `CV_EXPORTS_W` directive helped to add setter
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 768

**Code Changes:**
```diff
 };
 
-class CV_EXPORTS_W QRCodeDetector
-{
+class CV_EXPORTS_W_SIMPLE QRCodeDetectorBase {
 public:
-    CV_WRAP QRCodeDetector();
-    ~QRCodeDetector();
+    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to "protected" (need to fix bindings first)
+    QRCodeDetectorBase();
 
```

Review comment:
added with `dnn::Model` style: ![image](https://github.com/opencv/opencv/assets/22337800/2a0c22d9-62dd-4509-ac24-ac6273e4f671)
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 968

**Code Changes:**
```diff
+
+QRCodeDetectorBase::QRCodeDetectorBase() {}
+
+bool QRCodeDetectorBase::detect(InputArray img, OutputArray points) const {
+    CV_Assert(p);
+    return p->detect(img, points);
+}
+
+std::string QRCodeDetectorBase::decode(InputArray img, InputArray points, OutputArray straight_qrcode) const {
+    CV_Assert(p);
+    return p->decode(img, points, straight_qrcode);
```

Review comment:
added `CV_Assert(p != nullptr);`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
I propose to make this fix in another PR. This fix will erase the history and increase the diff.
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 #define OPENCV_OBJDETECT_HPP
 
 #include "opencv2/core.hpp"
+#include "opencv2/objdetect/aruco_detector.hpp"
 
 /**
 @defgroup objdetect Object Detection
@@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder {
 
```

Review comment:
first was added `QRCodeDetectorAruco& setDetectorParameters` now were added `QRCodeDetector& setEpsX`, `QRCodeDetector& setEpsY`, `QRCodeDetector& setUseAlignmentMarkers` now it's done)
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
I moved `decodeCurved` and `detectAndDecodeCurved` to `ImplContour`. I think I've fixed everything you asked for. Is there anything else that needs to be fixed?
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 768

**Code Changes:**
```diff
 };
 
-class CV_EXPORTS_W QRCodeDetector
-{
+class CV_EXPORTS_W_SIMPLE QRCodeDetectorBase {
 public:
-    CV_WRAP QRCodeDetector();
-    ~QRCodeDetector();
+    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to "protected" (need to fix bindings first)
+    QRCodeDetectorBase();
 
```

Review comment:
> `//CV_DEPRECATED_EXTERNAL` Why is it commented?
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 968

**Code Changes:**
```diff
+
+QRCodeDetectorBase::QRCodeDetectorBase() {}
+
+bool QRCodeDetectorBase::detect(InputArray img, OutputArray points) const {
+    CV_Assert(p);
+    return p->detect(img, points);
+}
+
+std::string QRCodeDetectorBase::decode(InputArray img, InputArray points, OutputArray straight_qrcode) const {
+    CV_Assert(p);
+    return p->decode(img, points, straight_qrcode);
```

Review comment:
Just `CV_Assert(p)` as we don't really want to retrieve the pointer itself. It is like `container.size() == 0` vs `container.empty()`.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 1005

**Code Changes:**
```diff
 
     double epsX, epsY;
-    vector<vector<Point2f>> alignmentMarkers;
-    vector<Point2f> updateQrCorners;
+    mutable vector<vector<Point2f>> alignmentMarkers;
+    mutable vector<Point2f> updateQrCorners;
     bool useAlignmentMarkers = true;
+
+    bool detect(InputArray in, OutputArray points) const override;
+    std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const override;
+    std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const override;
```

Review comment:
suspicious code, need to be revised later.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
no need braces here: `std::static_pointer_cast<ImplContour>(p)` --- checked `dynamic_pointer_cast` is more secure.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 4083

**Code Changes:**
```diff
+    scaleTimingPatternScore = 0.9f;
+}
+
+namespace {
+
+struct FinderPatternInfo {
+    FinderPatternInfo() {}
+
+    FinderPatternInfo(const vector<Point2f>& patternPoints): points(patternPoints) {
+        float minSin = 1.f;
+        for (int i = 0; i < 4; i++) {
```

Review comment:
BTW, it makes sense to hide local internal classes (especially with some generic names) into inner anonymous namespace.
**File:** samples/cpp/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -12,6 +12,7 @@ using namespace cv;
 static int liveQRCodeDetect();
 static int imageQRCodeDetect(const string& in_file);
 
+static bool g_useArucoBased = false;
 static bool g_modeMultiQR = false;
 static bool g_detectOnly = false;
 
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
     const string keys =
```

Review comment:
Use `const reference` for inputs
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -949,34 +949,99 @@ vector<Point2f> QRDetect::getQuadrilateral(vector<Point2f> angle_list)
     return result_angle_list;
 }
 
+struct QRCodeDetectorBase::Impl {
+    virtual ~Impl() {}
+    virtual bool detect(InputArray img, OutputArray points) const = 0;
+    virtual std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode) const = 0;
+    virtual std::string detectAndDecode(InputArray img, OutputArray points, OutputArray straight_qrcode) const = 0;
+    virtual bool detectMulti(InputArray img, OutputArray points) const = 0;
```

Review comment:
added `dynamic_pointer_cast` instead `static_pointer_cast`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 4083

**Code Changes:**
```diff
+    scaleTimingPatternScore = 0.9f;
+}
+
+namespace {
+
+struct FinderPatternInfo {
+    FinderPatternInfo() {}
+
+    FinderPatternInfo(const vector<Point2f>& patternPoints): points(patternPoints) {
+        float minSin = 1.f;
+        for (int i = 0; i < 4; i++) {
```

Review comment:
added `FinderPatternInfo` and `QRCode` into anonymous namespace
**File:** samples/cpp/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco

**Code Changes:**
```diff
@@ -12,6 +12,7 @@ using namespace cv;
 static int liveQRCodeDetect();
 static int imageQRCodeDetect(const string& in_file);
 
+static bool g_useArucoBased = false;
 static bool g_modeMultiQR = false;
 static bool g_detectOnly = false;
 
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
     const string keys =
```

Review comment:
added `const reference` and added const to `decode` methods
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 968

**Code Changes:**
```diff
+
+QRCodeDetectorBase::QRCodeDetectorBase() {}
+
+bool QRCodeDetectorBase::detect(InputArray img, OutputArray points) const {
+    CV_Assert(p);
+    return p->detect(img, points);
+}
+
+std::string QRCodeDetectorBase::decode(InputArray img, InputArray points, OutputArray straight_qrcode) const {
+    CV_Assert(p);
+    return p->decode(img, points, straight_qrcode);
```

Review comment:
added just `CV_Assert(p)`
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #23264: Add detect qr with aruco
**Review Line:** 768

**Code Changes:**
```diff
 };
 
-class CV_EXPORTS_W QRCodeDetector
-{
+class CV_EXPORTS_W_SIMPLE QRCodeDetectorBase {
 public:
-    CV_WRAP QRCodeDetector();
-    ~QRCodeDetector();
+    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to "protected" (need to fix bindings first)
+    QRCodeDetectorBase();
 
```

Review comment:
removed the comments
**File:** modules/imgproc/test/test_cvtyuv.cpp
**Change Type:** modified
**Context:** PR #23657: Added check that YUYV input of cvtColor has even width.

**Code Changes:**
```diff
@@ -724,4 +724,13 @@ INSTANTIATE_TEST_CASE_P(cvt422, Imgproc_ColorYUV,
                       (int)COLOR_YUV2RGBA_YUY2, (int)COLOR_YUV2BGRA_YUY2, (int)COLOR_YUV2RGBA_YVYU, (int)COLOR_YUV2BGRA_YVYU,
                       (int)COLOR_YUV2GRAY_UYVY, (int)COLOR_YUV2GRAY_YUY2));
 
-}} // namespace
+}
+
+TEST(cvtColorUYVY, size_issue_21035)
+{
+    Mat input = Mat::zeros(1, 1, CV_8UC2);
```

Review comment:
Here you pass `CV_8UC1` Mat as input, but I it is rejected early, before width check, because only 2 channel arrays are permitted. Does it make sense to check multiple `cn` sizes?
**File:** modules/imgproc/src/color.simd_helpers.hpp
**Change Type:** modified
**Context:** PR #23657: Added check that YUYV input of cvtColor has even width.
**Review Line:** 108

**Code Changes:**
```diff
@@ -104,6 +104,10 @@ struct CvtHelper
             CV_Assert( sz.width % 2 == 0 && sz.height % 3 == 0);
             dstSz = Size(sz.width, sz.height * 2 / 3);
             break;
+        case FROM_UYVY:
+            CV_Assert( sz.width % 2 == 0);
+            dstSz = sz;
+            break;
         case NONE:
         default:
             dstSz = sz;
```

Review comment:
Shouldn't it be `(scn * sz.width) % 4 == 0`? (currently `scn` has to be 2 but, as I understand, it can in theory be 1 or 4 too)
**File:** modules/imgproc/test/test_cvtyuv.cpp
**Change Type:** modified
**Context:** PR #23657: Added check that YUYV input of cvtColor has even width.

**Code Changes:**
```diff
@@ -724,4 +724,13 @@ INSTANTIATE_TEST_CASE_P(cvt422, Imgproc_ColorYUV,
                       (int)COLOR_YUV2RGBA_YUY2, (int)COLOR_YUV2BGRA_YUY2, (int)COLOR_YUV2RGBA_YVYU, (int)COLOR_YUV2BGRA_YVYU,
                       (int)COLOR_YUV2GRAY_UYVY, (int)COLOR_YUV2GRAY_YUY2));
 
-}} // namespace
+}
+
+TEST(cvtColorUYVY, size_issue_21035)
+{
+    Mat input = Mat::zeros(1, 1, CV_8UC2);
```

Review comment:
Fixed, used 8uc2.
**File:** modules/videoio/src/videoio_registry.cpp
**Change Type:** modified
**Context:** PR #23718: (5.x) Merge 4.x - Contrib PR: https://github.com/opencv/opencv_contrib/pull/3501 Extra PR: https://github.com/opencv/opencv_extra/pull/1066...

**Code Changes:**
```diff
@@ -183,6 +183,12 @@ static const struct VideoBackendInfo builtin_backends[] =
     // dropped backends: MIL, TYZX
 };
 
+#if 0 // deprecated_backends is empty in 5.x for now
+static const struct VideoDeprecatedBackendInfo deprecated_backends[] =
+{
+};
+#endif
+
```

Review comment:
I believe `#if 0` should look better for disabling of related functionality of `deprecated_backends`
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #23371: `cuda`: Add bindings to allow `GpuMat` and `Stream` objects to be initialized from memory initialized in other libraries

**Code Changes:**
```diff
@@ -567,6 +567,29 @@ The function does not reallocate memory if the matrix has proper attributes alre
  */
 CV_EXPORTS_W void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr);
 
+/** @brief Bindings overload to create a GpuMat from existing GPU memory.
+@param rows Row count.
+@param cols Column count.
+@param type Type of the matrix.
+@param cudaMemoryAddress Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified \a cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
+@param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to Mat::AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.
```

Review comment:
> int_least64_t We should avoid that type. Bindings could be improperly generated for unsupported types. Why `size_t` doesn't work here?