nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/test/test_charucodetection.cpp
**Change Type:** modified
**Context:** PR #23138: fix charuco matchImagePoints

**Code Changes:**
```diff
@@ -656,4 +656,31 @@ TEST(Charuco, issue_14014)
     EXPECT_EQ(Size(4, 1), rejectedPoints[0].size()); // check dimension of rejected corners after successfully refine
 }
 
+
+TEST(Charuco, testmatchImagePoints)
+{
+    aruco::CharucoBoard board(Size(2, 3), 1.f, 0.5f, aruco::getPredefinedDictionary(aruco::DICT_4X4_50));
+    auto chessboardPoints = board.getChessboardCorners();
+
```

Review comment:
also fixed checks: ``` for (size_t i = 0ull; i < detectedCharucoCorners.size(); i++) { EXPECT_EQ(detectedCharucoCorners[i], imagePoints[i]); EXPECT_EQ(chessboardPoints[i].x, objPoints[i].x); EXPECT_EQ(chessboardPoints[i].y, objPoints[i].y); } ```
**File:** modules/objdetect/misc/python/test/test_objdetect_aruco.py
**Change Type:** modified
**Context:** PR #23138: fix charuco matchImagePoints
**Review Line:** 320

**Code Changes:**
```diff
 
+    def test_aruco_match_image_points(self):
+        aruco_dict = cv.aruco.getPredefinedDictionary(cv.aruco.DICT_4X4_50)
+        board_size = (3, 4)
+        board = cv.aruco.GridBoard(board_size, 5.0, 1.0, aruco_dict)
+        aruco_corners = np.array(board.getObjPoints())[:, :, :2]
+        aruco_ids = board.getIds()
+        obj_points, img_points = board.matchImagePoints(aruco_corners, aruco_ids)
+        aruco_corners = aruco_corners.reshape(-1, 2)
+
+        self.assertEqual(aruco_corners.shape[0], obj_points.shape[0])
```

Review comment:
I am creating pseudo-detected `aruco_corners` based on `objPoints`. `aruco_corners` uses 2d points (`Point2f`), but `objPoints` uses 3d points (`Point3f`) and we need 3D -> 2D conversion.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** modified
**Context:** PR #23138: fix charuco matchImagePoints

**Code Changes:**
```diff
@@ -58,14 +58,22 @@ class CV_EXPORTS_W_SIMPLE Board {
     CV_WRAP const Point3f& getRightBottomCorner() const;
 
     /** @brief Given a board configuration and a set of detected markers, returns the corresponding
-     * image points and object points to call solvePnP()
+     * image points and object points, can be used in solvePnP()
      *
      * @param detectedCorners List of detected marker corners of the board.
-     * For CharucoBoard class you can set list of charuco corners.
-     * @param detectedIds List of identifiers for each marker or list of charuco identifiers for each corner.
```

Review comment:
`imgPoint` could be reordered relative to `detectedCorners`
**File:** modules/dnn/test/test_tflite_importer.cpp
**Change Type:** modified
**Context:** PR #23409: Import and inference INT8 quantized TFLite model

**Code Changes:**
```diff
@@ -130,6 +130,22 @@ TEST(Test_TFLite, max_unpooling)
     }
 }
 
+TEST(Test_TFLite, EfficientDet_int8) {
+    Net net = readNet(findDataFile("dnn/tflite/coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite", false));
+
+    Mat img = imread(findDataFile("dnn/dog416.png"));
+    Mat blob = blobFromImage(img, 1.0, Size(320, 320));
+
```

Review comment:
Please use this form of initialization: ``` Mat_<float> ref({3, 7}, { 0, 7, 0.62890625, 0.6014542579650879, 0.13300055265426636, 0.8977657556533813, 0.292389452457428, 0, 17, 0.56640625, 0.15983937680721283, 0.35905322432518005, 0.5155506730079651, 0.9409466981887817, 0, 1, 0.5, 0.14357104897499084, 0.2240825891494751, 0.7183101177215576, 0.9140362739562988 }); ```
**File:** modules/dnn/test/test_tflite_importer.cpp
**Change Type:** modified
**Context:** PR #23409: Import and inference INT8 quantized TFLite model

**Code Changes:**
```diff
@@ -130,6 +130,22 @@ TEST(Test_TFLite, max_unpooling)
     }
 }
 
+TEST(Test_TFLite, EfficientDet_int8) {
+    Net net = readNet(findDataFile("dnn/tflite/coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite", false));
+
+    Mat img = imread(findDataFile("dnn/dog416.png"));
+    Mat blob = blobFromImage(img, 1.0, Size(320, 320));
+
```

Review comment:
Increase tolerance to pass "debug" test: 0.06 => 0.1 `normAssertDetections(ref, out, "", 0.5, 0.05, 0.1);`
**File:** modules/dnn/src/tflite/tflite_importer.cpp
**Change Type:** modified
**Context:** PR #23409: Import and inference INT8 quantized TFLite model

**Code Changes:**
```diff
@@ -61,8 +61,17 @@ class TFLiteImporter {
     void parseConcat(const Operator& op, const std::string& opcode, LayerParams& layerParams);
     void parseResize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
     void parseDeconvolution(const Operator& op, const std::string& opcode, LayerParams& layerParams);
-
-    int addPermuteLayer(const std::vector<int>& order, const std::string& permName, const std::pair<int, int>& inpId);
+    void parseQuantize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseDequantize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseDetectionPostProcess(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseActivation(const Operator& op, const std::string& opcode, LayerParams& layerParams);
```

Review comment:
This should not be a common change. Many handlers just don't use `activParams` at all. Compiler warnings are disabled in dnn module, many warnings are really generated here for that change.
**File:** modules/dnn/src/tflite/tflite_importer.cpp
**Change Type:** modified
**Context:** PR #23409: Import and inference INT8 quantized TFLite model

**Code Changes:**
```diff
@@ -61,8 +61,17 @@ class TFLiteImporter {
     void parseConcat(const Operator& op, const std::string& opcode, LayerParams& layerParams);
     void parseResize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
     void parseDeconvolution(const Operator& op, const std::string& opcode, LayerParams& layerParams);
-
-    int addPermuteLayer(const std::vector<int>& order, const std::string& permName, const std::pair<int, int>& inpId);
+    void parseQuantize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseDequantize(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseDetectionPostProcess(const Operator& op, const std::string& opcode, LayerParams& layerParams);
+    void parseActivation(const Operator& op, const std::string& opcode, LayerParams& layerParams);
```

Review comment:
Problem of handlers API is here. We should not have any heavy postprocessing after the handler call. Post-processing should be done in the handler itself (because handler defines post-processing steps). Provide a method for registration of DNN layers to be called from handlers. See ONNX importer implementation for reference.
**File:** samples/python/videocapture_obsensor.py
**Change Type:** added
**Context:** PR #23531: Add python sample of how to use Orbbec camera.

**Code Changes:**
```diff
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+
+import numpy as np
+import sys
+import cv2 as cv
+
+
+def main():
+    # Open Orbbec depth sensor
```

Review comment:
How about adding code to convert the depth to a color map? Since we have a cpp sample at https://github.com/opencv/opencv/blob/4.x/samples/cpp/videocapture_obsensor.cpp#L40, I think we better have a unified output.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
"Aruco dictionary name for charuco board"
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
"Custom aruco dictionary file for charuco board"
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
No need to use `cv::Ptr` for board. You can allocate it on stack as local variable.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
No need to create yet another detector. CharucoBoard has `detectBoard` method. It does all you need.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
It's legacy API from contrib. please do not use it.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
ArucoDetector is not used.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
You can initialize found as false beforehand and get rid of all else branches.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
Still relevant.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
`\n` is missing at the end of the line.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
No need to create CharcuoDetector and Dictionary each frame. It should be done once out of the loop.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
I propose to cast to size_t.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
Discussed the issue offline. Decided to remove +1, but add note about the board size units. Chessboard and radon board size are defined in inner corners, all other boards - in elements (circles or squares).
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #23486: Add charuco pattern into calibration.cpp

**Code Changes:**
```diff
@@ -5,6 +5,7 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/videoio.hpp"
 #include "opencv2/highgui.hpp"
+#include <opencv2/objdetect/charuco_detector.hpp>
 
 #include <cctype>
 #include <stdio.h>
@@ -48,15 +49,25 @@ static void help(char** argv)
 {
```

Review comment:
No space at the end of the line.
**File:** modules/dnn/src/layers/cpu_kernels/convolution.cpp
**Change Type:** modified
**Context:** PR #23511: DNN: try to fix the sporadic crashes in perf_dnn
**Review Line:** 506

**Code Changes:**
```diff
@@ -502,7 +503,7 @@ void runFastConv(InputArray _input, OutputArray _output, const Ptr<FastConv>& co
             }
     }
 
-    int MAX_STRIPES = (56 + CONV_NR - 1)/CONV_NR;
+    int MAX_STRIPES = conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN ? 1 : (56 + CONV_NR - 1)/CONV_NR;
 
     // Friendly to L1 cache
     const int K_BLOCK_SIZE = conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN ? 1 : 32;
```

Review comment:
> `(56 + CONV_NR - 1)/CONV_NR` BTW, there is `divUp()` call for that
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #23501: Added LSTM and GRU tests for various batch and input length sizes

**Code Changes:**
```diff
@@ -1262,6 +1262,48 @@ TEST_P(Test_ONNX_layers, GRU)
     testONNXModels("gru", npy, 0, 0, false, false);
 }
 
+TEST_P(Test_ONNX_layers, gru_cell_batchsize_50_seqlen_1)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2022010000)
+    // IE exception: Node GRU_22 was not assigned on any pointed device
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16))
+        applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
```

Review comment:
It's there in CI for CPU case: ``` [ RUN ] Test_ONNX_layers.LSTM_cell_with_peepholes/0, where GetParam() = OCV/CPU [ OK ] Test_ONNX_layers.LSTM_cell_with_peepholes/0 (1 ms) ``` And CUDA case: ``` [ RUN ] Test_ONNX_layers.LSTM_cell_with_peepholes/0, where GetParam() = CUDA/CUDA [ OK ] Test_ONNX_layers.LSTM_cell_with_peepholes/0 (3 ms) [ RUN ] Test_ONNX_layers.LSTM_cell_with_peepholes/1, where GetParam() = CUDA/CUDA_FP16 [ OK ] Test_ONNX_layers.LSTM_cell_with_peepholes/1 (4 ms) [ RUN ] Test_ONNX_layers.LSTM_cell_with_peepholes/2, where GetParam() = OCV/CPU [ OK ] Test_ONNX_layers.LSTM_cell_with_peepholes/2 (1 ms) ```
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
Currently, this patch breaks the compatibility of the java bindings.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
It is expected. As this patch modifies functions instead of adding overloads.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
> const Scalar& scalefactor = 1.0 Default ("implicit" ctor) value may not work as expected. There are issues of Scalar initialization: ```.cpp Scalar a(2.0); cout << a << endl; Scalar b = Scalar::all(3.0); cout << b << endl; ``` ``` [2, 0, 0, 0] [3, 3, 3, 3] ```
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
Yes, since the 0 for `scalefactor` is meaningless. I addded code in this patch to convert from `Scalar a(2.0);` to `Scalar a = Scalar::all(2.0);`: ```c++ Scalar scalefactor = param.scalefactor; // Because 0 is meaningless in scalefactor. Convert the 0 to if (scalefactor[1] == 0 && scalefactor[2] == 0 && scalefactor[3] == 0) { CV_Assert(scalefactor[0] != 0 && "Scalefactor of 0 is meaningless."); scalefactor = Scalar::all(scalefactor[0]); } ```
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
> `_PP_` Pre-Process Post-Process both are "PP"
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam
**Review Line:** 1220

**Code Changes:**
```diff
+        CV_WRAP Image2BlobParams();
+        CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(),
+                            bool swapRB = false, int ddepth = CV_32F, DataLayout datalayout = DNN_LAYOUT_NCHW,
+                            ImagePaddingMode mode = DNN_PMODE_NULL);
+
+        CV_PROP_RW Scalar scalefactor; //!< scalefactor multiplier for input image values.
+        CV_PROP_RW Size size;    //!< Spatial size for output image.
+        CV_PROP_RW Scalar mean;  //!< Scalar with mean values which are subtracted from channels.
+        CV_PROP_RW bool swapRB;  //!< Flag which indicates that swap first and last channels
+        CV_PROP_RW int ddepth;   //!< Depth of output blob. Choose CV_32F or CV_8U.
+        CV_PROP_RW DataLayout datalayout; //!< Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.
```

Review comment:
Does `(1, 0, 0, 0)` interpreted internally as `(1,1,1,1)`?
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam
**Review Line:** 1220

**Code Changes:**
```diff
+        CV_WRAP Image2BlobParams();
+        CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(),
+                            bool swapRB = false, int ddepth = CV_32F, DataLayout datalayout = DNN_LAYOUT_NCHW,
+                            ImagePaddingMode mode = DNN_PMODE_NULL);
+
+        CV_PROP_RW Scalar scalefactor; //!< scalefactor multiplier for input image values.
+        CV_PROP_RW Size size;    //!< Spatial size for output image.
+        CV_PROP_RW Scalar mean;  //!< Scalar with mean values which are subtracted from channels.
+        CV_PROP_RW bool swapRB;  //!< Flag which indicates that swap first and last channels
+        CV_PROP_RW int ddepth;   //!< Depth of output blob. Choose CV_32F or CV_8U.
+        CV_PROP_RW DataLayout datalayout; //!< Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.
```

Review comment:
> We could deprecate them and suggest using a new variant. That's a workaround for me. > Does (1, 0, 0, 0) interpreted internally as (1,1,1,1)? Yes.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
`ImagePParam` or just `ImageParam`? Any suggestion？
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
Maybe we should just retain the 2 variants with OutputArray blob. Also, modify the name to "blobFromImageWithParams", otherwise it's grammatically incorrect
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
ImageProcessMode is very generic name. What about "ImagePaddingMode"?
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
DNN_PMODE_CENTER => DNN_PMODE_CROP_CENTER
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
crop flag and ImageProcessMode duplicate each other. Can we remove "crop"?
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #22750: DNN: Add New API blobFromImageParam

**Code Changes:**
```diff
@@ -108,6 +108,21 @@ CV__DNN_INLINE_NS_BEGIN
         DNN_TARGET_NPU,
     };
 
+    /**
+     * @brief Enum of data layout for model inference.
+     * @see Image2BlobParams
+     */
+    enum DataLayout
+    {
```

Review comment:
IMHO, `ImageParam` is too generic. We may have conflicts in the future. - `Image2BlobParams` ? --- BTW, any thoughts about `blob -> tensor` migration? Seems `blob` was widely used in Caffe only.