nareshmlx/opencv-pr huggingface dataset:
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
It's from the Android Java/Kotlin API: https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities But I could not find it in the NDK. I think this is the reason why the COLOR_FormatYUV420Planar and COLOR_FormatYUV420SemiPlanar are already defined like that.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android
**Review Line:** 507

**Code Changes:**
```diff
+            if (AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM == buffer.format) {
+                Mat bufferMat(image.rows, image.cols, CV_8UC4, buffer.bits, buffer.stride * 4);
+                cvtColor(image, bufferMat, CV_BGR2RGBA);
+            } else {
+                LOGE("Unknow surface buffer format: %u", buffer.format);
+            }
+
+            ANativeWindow_unlockAndPost(surface);
+        }
+        #else
+        LOGV("[write] image: %d  x %d", image.cols, image.rows);
```

Review comment:
I didn't find how to signal errors from this virtual function. If it's possible it should be the best solution. If not I'll put at least a warning.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
Agree. Unless there is a way to signal errors (like previous comment).
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
I think I already try it without success. I try it again just to be sure.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android
**Review Line:** 507

**Code Changes:**
```diff
+            if (AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM == buffer.format) {
+                Mat bufferMat(image.rows, image.cols, CV_8UC4, buffer.bits, buffer.stride * 4);
+                cvtColor(image, bufferMat, CV_BGR2RGBA);
+            } else {
+                LOGE("Unknow surface buffer format: %u", buffer.format);
+            }
+
+            ANativeWindow_unlockAndPost(surface);
+        }
+        #else
+        LOGV("[write] image: %d  x %d", image.cols, image.rows);
```

Review comment:
Let's print to logcat at least.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
Locat warning should be enought
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
Great. I searched for something like but I did't found it. I would be great to add RGB (and all versions) => NV12 / NV21 conversion directly in cvtColor.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
Please add comment with reference. All magic numbers should be described.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
Yes, It's very rare case that's why it's not there. Please file a ticket with link to this code, when PR is merged.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android
**Review Line:** 635

**Code Changes:**
```diff
+
+        #if __ANDROID_API__ >= 26
+        if (NULL != surface) ANativeWindow_release(surface);
+        #endif
+
+        if (fd >= 0) ::close(fd);
+        if (NULL != format) AMediaFormat_delete(format);
+
+        format = NULL;
+        encoder = NULL;
+        muxer = NULL;
```

Review comment:
According to open man page it returns -1 in case of error, else it's a valid value. Maybe 0 will never be returned (I think is stdout) but I prefer to keep as: * < 0 - invalid * >= valid
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
I already create an issue about. For now I'll just use merge.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22503: Add H264 / H265 writter support for Android

**Code Changes:**
```diff
@@ -13,14 +13,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <android/log.h>
-
+#include <android/native_window.h>
 #include "media/NdkMediaCodec.h"
+#include "media/NdkMediaMuxer.h"
 #include "media/NdkMediaExtractor.h"
+#include "media/NdkMediaFormat.h"
```

Review comment:
You are right, it works as expected. It's my fault. I thought the stride is the number of items (like cols) but it is the number of bytes.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198

**Code Changes:**
```diff
@@ -48,15 +48,29 @@ class AndroidMediaNdkCapture : public IVideoCapture
 public:
     AndroidMediaNdkCapture():
         sawInputEOS(false), sawOutputEOS(false),
-        frameWidth(0), frameHeight(0), colorFormat(0) {}
+        frameStride(0), frameWidth(0), frameHeight(0), colorFormat(0),
+        videoWidth(0), videoHeight(0),
+        videoFrameCount(0),
+        videoRotation(0), videoRotationCode(-1),
+        videoOrientationAuto(false) {}
```

Review comment:
OpenCV uses BGR as default color format in API. The change is consistent and breaks existing code.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198

**Code Changes:**
```diff
@@ -48,15 +48,29 @@ class AndroidMediaNdkCapture : public IVideoCapture
 public:
     AndroidMediaNdkCapture():
         sawInputEOS(false), sawOutputEOS(false),
-        frameWidth(0), frameHeight(0), colorFormat(0) {}
+        frameStride(0), frameWidth(0), frameHeight(0), colorFormat(0),
+        videoWidth(0), videoHeight(0),
+        videoFrameCount(0),
+        videoRotation(0), videoRotationCode(-1),
+        videoOrientationAuto(false) {}
```

Review comment:
BTW, on Android Java's CameraView uses RGBA (32-bit) - there is explicit `.rgba()` method. Need to check discussions/decisions from the first PR related to VideoCapture on Android.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198

**Code Changes:**
```diff
@@ -48,15 +48,29 @@ class AndroidMediaNdkCapture : public IVideoCapture
 public:
     AndroidMediaNdkCapture():
         sawInputEOS(false), sawOutputEOS(false),
-        frameWidth(0), frameHeight(0), colorFormat(0) {}
+        frameStride(0), frameWidth(0), frameHeight(0), colorFormat(0),
+        videoWidth(0), videoHeight(0),
+        videoFrameCount(0),
+        videoRotation(0), videoRotationCode(-1),
+        videoOrientationAuto(false) {}
```

Review comment:
So maybe the issue 22214 it's somewhere in the save. I'll try to get more information first.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198

**Code Changes:**
```diff
@@ -48,15 +48,29 @@ class AndroidMediaNdkCapture : public IVideoCapture
 public:
     AndroidMediaNdkCapture():
         sawInputEOS(false), sawOutputEOS(false),
-        frameWidth(0), frameHeight(0), colorFormat(0) {}
+        frameStride(0), frameWidth(0), frameHeight(0), colorFormat(0),
+        videoWidth(0), videoHeight(0),
+        videoFrameCount(0),
+        videoRotation(0), videoRotationCode(-1),
+        videoOrientationAuto(false) {}
```

Review comment:
I create an image like this: red = 0, green = 100 and blue = 200. I used ffmpeg to create a video from this image. When I read them on my laptop (and the image on android) they are in BGR format indeed. Maybe the issue is in imwrite. I'll prepare a new PR with the BGR format (as it was before). https://user-images.githubusercontent.com/7062741/183653882-18bcafb8-3a12-4e75-9f8f-da81fd8c4d3c.mp4 ![r0_g100_b200](https://user-images.githubusercontent.com/7062741/183653886-d7faba80-e9c2-4303-8fd5-b93013d3e996.png)
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198
**Review Line:** 157

**Code Changes:**
```diff
         if (buffer.empty()) {
             return false;
         }
-        Mat yuv(frameHeight + frameHeight/2, frameWidth, CV_8UC1, buffer.data());
+
+        Mat yuv(frameHeight + frameHeight/2, frameStride, CV_8UC1, buffer.data());
+
         if (colorFormat == COLOR_FormatYUV420Planar) {
-            cv::cvtColor(yuv, out, cv::COLOR_YUV2BGR_YV12);
+            cv::cvtColor(yuv, frame, cv::COLOR_YUV2BGR_YV12);
         } else if (colorFormat == COLOR_FormatYUV420SemiPlanar) {
```

Review comment:
You need to use this constructor: ``` Mat (Size size, int type, void *data, size_t step=AUTO_STEP); ``` where step=stride.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198
**Review Line:** 169

**Code Changes:**
```diff
             LOGE("Unsupported video format: %d", colorFormat);
             return false;
         }
+
+        Mat croppedFrame = frame(Rect(0, 0, videoWidth, videoHeight));
+        out.assign(croppedFrame);
+
+        if (videoOrientationAuto && -1 != videoRotationCode) {
+            cv::rotate(out, out, videoRotationCode);
+        }
+
```

Review comment:
This is not needed with proper constructor.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198
**Review Line:** 157

**Code Changes:**
```diff
         if (buffer.empty()) {
             return false;
         }
-        Mat yuv(frameHeight + frameHeight/2, frameWidth, CV_8UC1, buffer.data());
+
+        Mat yuv(frameHeight + frameHeight/2, frameStride, CV_8UC1, buffer.data());
+
         if (colorFormat == COLOR_FormatYUV420Planar) {
-            cv::cvtColor(yuv, out, cv::COLOR_YUV2BGR_YV12);
+            cv::cvtColor(yuv, frame, cv::COLOR_YUV2BGR_YV12);
         } else if (colorFormat == COLOR_FormatYUV420SemiPlanar) {
```

Review comment:
I think I already tried it without luck, but I'll double check it.
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #22227: Fix issues: #22214 and #22198
**Review Line:** 169

**Code Changes:**
```diff
             LOGE("Unsupported video format: %d", colorFormat);
             return false;
         }
+
+        Mat croppedFrame = frame(Rect(0, 0, videoWidth, videoHeight));
+        out.assign(croppedFrame);
+
+        if (videoOrientationAuto && -1 != videoRotationCode) {
+            cv::rotate(out, out, videoRotationCode);
+        }
+
```

Review comment:
Actually for a video 1920 x 1080 the frame size is actually 1920 x 1088 (the height and width are aligned to a multiple of 16). The proposed construction should solve the problem with aligned width but not the aligned height. Is there another way to "cut" rows at the end of a Mat ?
**File:** modules/dnn/src/tensorflow/tf_importer.cpp
**Change Type:** modified
**Context:** PR #22448: changed names of permutations if Reshpe is in NHWC
**Review Line:** 1137

**Code Changes:**
```diff
         {
             int order[] = {0, 3, 1, 2};  // Transform back to OpenCV's NCHW.
-            addPermuteLayer(order, name + "/nchw", inpId);
+
+            setName = changedType ? name : name + "/nchw";
+            addPermuteLayer(order, setName, inpId);
             inpLayout = DATA_LAYOUT_NCHW;
         }
 
```

Review comment:
***For reviewers***: This issue is triggered when this if condition is entered. `addPermuteLayer` sets the output name to `name + "/nchw"`, leading to the incorrect input fetched by the next layer.
**File:** modules/dnn/src/tensorflow/tf_importer.cpp
**Change Type:** modified
**Context:** PR #22448: changed names of permutations if Reshpe is in NHWC
**Review Line:** 1137

**Code Changes:**
```diff
         {
             int order[] = {0, 3, 1, 2};  // Transform back to OpenCV's NCHW.
-            addPermuteLayer(order, name + "/nchw", inpId);
+
+            setName = changedType ? name : name + "/nchw";
+            addPermuteLayer(order, setName, inpId);
             inpLayout = DATA_LAYOUT_NCHW;
         }
 
```

Review comment:
Why do we need `name + "/nchw"` node at the end? I don't think other layers know this node by name.
**File:** modules/dnn/src/tensorflow/tf_importer.cpp
**Change Type:** modified
**Context:** PR #22448: changed names of permutations if Reshpe is in NHWC
**Review Line:** 1137

**Code Changes:**
```diff
         {
             int order[] = {0, 3, 1, 2};  // Transform back to OpenCV's NCHW.
-            addPermuteLayer(order, name + "/nchw", inpId);
+
+            setName = changedType ? name : name + "/nchw";
+            addPermuteLayer(order, setName, inpId);
             inpLayout = DATA_LAYOUT_NCHW;
         }
 
```

Review comment:
Heh, I was investigating it [already](https://github.com/opencv/opencv/pull/19641#issuecomment-892756609), but didn't get the answer.
**File:** modules/calib/src/calibration.cpp
**Change Type:** modified
**Context:** PR #22460: Stereo calibration fixed when intrinsic guess is given
**Review Line:** 1034

**Code Changes:**
```diff
+
+                            for(int j = 0; j < 3; j++)
+                                J_LR.at<double>(p, j) = de3dr2(j);
+
+                            for(int j = 0; j < 3; j++)
+                                J_LR.at<double>(p, 3+j) = de3dt2(j);
                         }
 
                         JtJ(Rect(0, 0, 6, 6)) += J_LR.t()*J_LR;
@@ -1050,8 +1055,8 @@ static double stereoCalibrateImpl(
                 }
```

Review comment:
This part could be done without memory copy. Let's discuss offline.
**File:** doc/pattern_tools/svgfig.py
**Change Type:** modified
**Context:** PR #22480: Save output file to local directory instead of desktop (for windows) - The issue was discussed on [opencv forum](https://forum.opencv.org/t...
**Review Line:** 456

**Code Changes:**
```diff
@@ -34,18 +34,6 @@
 except NameError:
     xrange = range  # Python 3
 
-
-if re.search("windows", platform.system(), re.I):
-    try:
-        import _winreg
-        _default_directory = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
-                             r"Software\Microsoft\Windows\Current Version\Explorer\Shell Folders"), "Desktop")[0]
-#   tmpdir = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Environment"), "TEMP")[0]
-#   if tmpdir[0:13] != "%USERPROFILE%":
-#     tmpdir = os.path.expanduser("~") + tmpdir[13:]
-    except:
-        _default_directory = os.path.expanduser("~") + os.sep + "Desktop"
```

Review comment:
`_default_directory` is not used any more. So it should be removed with initialization code.
**File:** doc/pattern_tools/svgfig.py
**Change Type:** modified
**Context:** PR #22480: Save output file to local directory instead of desktop (for windows) - The issue was discussed on [opencv forum](https://forum.opencv.org/t...
**Review Line:** 456

**Code Changes:**
```diff
@@ -34,18 +34,6 @@
 except NameError:
     xrange = range  # Python 3
 
-
-if re.search("windows", platform.system(), re.I):
-    try:
-        import _winreg
-        _default_directory = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
-                             r"Software\Microsoft\Windows\Current Version\Explorer\Shell Folders"), "Desktop")[0]
-#   tmpdir = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Environment"), "TEMP")[0]
-#   if tmpdir[0:13] != "%USERPROFILE%":
-#     tmpdir = os.path.expanduser("~") + tmpdir[13:]
-    except:
-        _default_directory = os.path.expanduser("~") + os.sep + "Desktop"
```

Review comment:
Nice catch. I removed it.
**File:** modules/gapi/src/executor/gstreamingexecutor.hpp
**Change Type:** modified
**Context:** PR #22451: G-API: Introduce abstract base classes for GExecutor and GStreamingExecutor
**Review Line:** 200

**Code Changes:**
```diff
-    bool running() const;
+    void setSource(GRunArgs &&args) override;
+    void start() override;
+    bool pull(cv::GRunArgsP &&outs) override;
+    bool pull(cv::GOptRunArgsP &&outs) override;
+    PyPullResult pull() override;
+    bool try_pull(cv::GRunArgsP &&outs) override;
+    void stop() override;
+    bool running() const override;
 };
 
```

Review comment:
Since `GStreamingExecutor` isn't exposed to python directly (only via `GStreamingCompiled`) it doesn't affect python, because `PyPullResult` matches to this API: https://github.com/opencv/opencv/blob/4.x/modules/gapi/include/opencv2/gapi/gstreaming.hpp#L277
**File:** modules/gapi/src/executor/gstreamingexecutor.hpp
**Change Type:** modified
**Context:** PR #22451: G-API: Introduce abstract base classes for GExecutor and GStreamingExecutor
**Review Line:** 200

**Code Changes:**
```diff
-    bool running() const;
+    void setSource(GRunArgs &&args) override;
+    void start() override;
+    bool pull(cv::GRunArgsP &&outs) override;
+    bool pull(cv::GOptRunArgsP &&outs) override;
+    PyPullResult pull() override;
+    bool try_pull(cv::GRunArgsP &&outs) override;
+    void stop() override;
+    bool running() const override;
 };
 
```

Review comment:
Python parser knows how to parse ` std::tuple<bool, cv::util::variant<cv::GRunArgs, cv::GOptRunArgs>>`, but don't know anything about `PyPullResult` which isn't used.
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #22306: DNN: Add qgemm and squeeze op13 supported on ONNXImporter

**Code Changes:**
```diff
@@ -192,6 +192,7 @@ class ONNXImporter
     void parseQSigmoid             (LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto);
     void parseQAvgPool             (LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto);
     void parseQConcat              (LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto);
+    void parseQGemm                (LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto);
 
     // '???' domain or '???' layer type
     void parseCustomLayer          (LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto);
@@ -2183,17 +2184,39 @@ void ONNXImporter::parseTranspose(LayerParams& layerParams, const opencv_onnx::N
 
```

Review comment:
Please insert space after <=
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #22306: DNN: Add qgemm and squeeze op13 supported on ONNXImporter
**Review Line:** 3291

**Code Changes:**
```diff
+// A * B + C = Y, we require that the dimension of A is [m, k], and the dimension of B is [n, k].
+// And the dim of output Y is [m, n]
+void ONNXImporter::parseQGemm(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto)
+{
+    int ninputs = node_proto.input_size();
+    CV_Assert(ninputs == 8 || ninputs == 9);
+
+    layerParams.type = "InnerProductInt8";
+
+    if (constBlobs.find(node_proto.input(3)) == constBlobs.end())
+        CV_Error(Error::StsNotImplemented, "Variable weights is not supported");
```

Review comment:
QGemm has 6-9 inputs, but I think this relies on the fact that C is not provided.
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #22306: DNN: Add qgemm and squeeze op13 supported on ONNXImporter
**Review Line:** 3296

**Code Changes:**
```diff
+    CV_Assert(ninputs == 8 || ninputs == 9);
+
+    layerParams.type = "InnerProductInt8";
+
+    if (constBlobs.find(node_proto.input(3)) == constBlobs.end())
+        CV_Error(Error::StsNotImplemented, "Variable weights is not supported");
+
+    Mat weights = getBlob(node_proto, 3);
+
+    if (!layerParams.get<int>("transB", 0))
+    {
```

Review comment:
`inp_sc`/`inp_zp` below can also be non-constant - so I think we should probably have new overload of `getGlob` that accepts error message and does this `CV_Error(Error::StSNotImplemented)` stuff under the hood.
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #22306: DNN: Add qgemm and squeeze op13 supported on ONNXImporter
**Review Line:** 3300

**Code Changes:**
```diff
+    if (constBlobs.find(node_proto.input(3)) == constBlobs.end())
+        CV_Error(Error::StsNotImplemented, "Variable weights is not supported");
+
+    Mat weights = getBlob(node_proto, 3);
+
+    if (!layerParams.get<int>("transB", 0))
+    {
+        transpose(weights, weights);
+    }
+
+    CV_Assert(layerParams.get<float>("alpha", 1) == 1.0f);
```

Review comment:
Do we support non-default values of `transA` or `alpha`?