nareshmlx/opencv-pr huggingface dataset:
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo
**Review Line:** 71

**Code Changes:**
```diff
+
+Marker Creation
+---------------
+
+Before their detection, markers need to be printed in order to be placed in the environment.
+Marker images can be generated using the `generateImageMarker()` function.
+
+For example, lets analyze the following call:
+
+@code{.cpp}
+cv::Mat markerImage;
```

Review comment:
Please add gen_pattern.py reference, if it supports dedicated aruco markers.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
It is specified by rotation and translation vectors. OpenCV provides cv::solvePnP function to do that.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
Please rewrite the sentence.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
The file is already mentioned in usage example. The not is not needed.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
not generation, but definition.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo
**Review Line:** 356

**Code Changes:**
```diff
+@code{.cpp}
+cv::aruco::Dictionary dictionary = cv::aruco::extendDictionary(36, 5);
+@endcode
+
+This will generate a customized dictionary composed of 36 markers of 5x5 bits. The process can take several
+seconds, depending on the parameters (it is slower for larger dictionaries and higher numbers of bits).
+
+Also you could use `aruco_dict_utils.cpp` sample inside the `opencv/samples/cpp`. This sample calculates
+the minimum Hamming distance for the generated dictionary and also allows you to create markers that are
+resistant to reflection.
+
```

Review comment:
I propose to add reference to dictionary generator tool here.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
Why do you need tags here?
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
extra space lines.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
It's bad idea. Defaults may change in code, but not tutorial. I propose to add reference to API description, but not mention defaults in tutorial text.
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
It's already mentioned in the example. Note is not needed.
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
The same is true for intermediate images that show algorithm steps.
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
I don't have the original image to replace the axes. I'll have to use a new image.
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
Ok, let's use the new one.
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
The last remaining PNG images are smaller in size than JPG images.
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
removed tag
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
fixed: ![image](https://github.com/opencv/opencv/assets/22337800/1518e15a-db96-4f70-bff1-dd8e713dc60c)
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo
**Review Line:** 71

**Code Changes:**
```diff
+
+Marker Creation
+---------------
+
+Before their detection, markers need to be printed in order to be placed in the environment.
+Marker images can be generated using the `generateImageMarker()` function.
+
+For example, lets analyze the following call:
+
+@code{.cpp}
+cv::Mat markerImage;
```

Review comment:
gen_pattern.py doesn't support the gereneration of single markers
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
![Uploading image.png…]()
**File:** doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,702 @@
+Detection of ArUco Markers {#tutorial_aruco_detection}
+==========================
+
+@next_tutorial{tutorial_aruco_board_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
fixed: `### Manual dictionary definition`
**File:** doc/tutorials/objdetect/aruco_board_detection/aruco_board_detection.markdown
**Change Type:** added
**Context:** PR #23018: Move Aruco tutorials and samples to main repo

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+Detection of ArUco boards {#tutorial_aruco_board_detection}
+=========================
+
+@prev_tutorial{tutorial_aruco_detection}
+
+|    |    |
+| -: | :- |
+| Original authors | Sergio Garrido, Alexander Panov |
+| Compatibility    | OpenCV >= 4.7.0 |
```

Review comment:
We have doxygen [command](https://github.com/opencv/opencv/blob/d792086ba66a76707e00ee7fffcec50289837fb4/doc/Doxyfile.in#L41) for this: https://github.com/opencv/opencv/blob/d792086ba66a76707e00ee7fffcec50289837fb4/doc/tutorials/app/video_write.markdown?plain=1#L166 Here and in other places.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
It makes sense to remove "add" from naming.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests
**Review Line:** 776

**Code Changes:**
```diff
+    lp.name = operation + "_Layer";
+    lp.set("operation", operation);
+    Ptr<EltwiseLayer> layer = EltwiseLayer::create(lp);
+
+    std::vector<int> input_shape = {batch_size, 1};
+    if (batch_size == 0)
+        input_shape.erase(input_shape.begin());
+
+    cv::Mat input1 = cv::Mat(input_shape, CV_32F, 1.0);
+    cv::Mat input2 = cv::Mat(input_shape, CV_32F, 1.0);
+    cv::randu(input1, 0.0, 1.0);
```

Review comment:
Are we sure that all the test cases are 1d?
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
`.at<float>(i)`
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
This triggers the debug assert when it is nd mat (n>2). See https://github.com/opencv/opencv/blob/49367b5bec57a0b135db4c2270604c14f5a5dc31/modules/core/include/opencv2/core/mat.inl.hpp#L938-L940
**File:** modules/dnn/src/layers/eltwise_layer.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -191,19 +191,19 @@ class EltwiseLayerImpl CV_FINAL : public EltwiseLayer
                          std::vector<MatShape> &internals) const CV_OVERRIDE
     {
         CV_Assert(inputs.size() >= 2);
-        CV_Assert(inputs[0].size() >= 2);
+        CV_Assert(inputs[0].size() >= 1);
         CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size());
         CV_Assert(op == SUM || coeffs.size() == 0);
 
         int dims = inputs[0].size();
```

Review comment:
CV_LOG_DEBUG
**File:** modules/dnn/src/layers/eltwise_layer.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -191,19 +191,19 @@ class EltwiseLayerImpl CV_FINAL : public EltwiseLayer
                          std::vector<MatShape> &internals) const CV_OVERRIDE
     {
         CV_Assert(inputs.size() >= 2);
-        CV_Assert(inputs[0].size() >= 2);
+        CV_Assert(inputs[0].size() >= 1);
         CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size());
         CV_Assert(op == SUM || coeffs.size() == 0);
 
         int dims = inputs[0].size();
```

Review comment:
It should be removed at all, IMHO.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
As we discussed offline the test us very weak. All indexes are zeros, all values are ones. I propose to use randShuffle for all indexes 0..size, randomize input values and prepare honest ground truth. See also https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
'(Layer1d, Accuracy)' sounds better for me.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Use Cammel Case for naming as in other tests.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
I propose to add "div" check and stay the matrix empty, if operation was not matched. It highlights errors and incorrect instantiation of test.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Camel Case naming.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
`lp.name = operation`?
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
I propose to use randomization here to exclude out-of-bound access issues and indexes issue. See theRNG.
**File:** modules/dnn/src/layers/eltwise_layer.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -191,19 +191,19 @@ class EltwiseLayerImpl CV_FINAL : public EltwiseLayer
                          std::vector<MatShape> &internals) const CV_OVERRIDE
     {
         CV_Assert(inputs.size() >= 2);
-        CV_Assert(inputs[0].size() >= 2);
+        CV_Assert(inputs[0].size() >= 1);
         CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size());
         CV_Assert(op == SUM || coeffs.size() == 0);
 
         int dims = inputs[0].size();
```

Review comment:
Sorry, I forgot it. I will remove
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
is it okay that we can not see layer type from test name in case we rename it to Layer1d?
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Isn't `NaryEltwise` the superseder of `Eltwise`? Why do we still updating this?
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Because when you create onnx graph it uses `NaryEltwise` layer, so we need test for that too
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Then we should use `NaryEltwise` for other importers as well and drop `Eltwise` in the end. Just try to reduce maintenance pressure.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
I agree, but some operations that `Eltwise` support are not supported by `NaryEltwise`, if I am not mistaken. This is kind of change should be make a separate PR. Here we have working test. Let's keep it. Once we drop `Eltwise` we also remove the test.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests

**Code Changes:**
```diff
@@ -618,6 +618,204 @@ TEST(Layer_LSTM_Test_Accuracy_with_, HiddenParams)
     normAssert(h_t_reference, outputs[0]);
 }
 
+typedef testing::TestWithParam<tuple<int, int>> Layer_Gather_1d_Test;
+TEST_P(Layer_Gather_1d_Test, Accuracy) {
+
+    int batch_size = get<0>(GetParam());
+    int axis = get<1>(GetParam());
+
```

Review comment:
Ok, generally agree with what your said. > but some operations that Eltwise support are not supported by NaryEltwise We will need a check when it is time to drop Eltwise.
**File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #24977: Primitive 1D Tests
**Review Line:** 777

**Code Changes:**
```diff
+    lp.set("operation", operation);
+    Ptr<EltwiseLayer> layer = EltwiseLayer::create(lp);
+
+    std::vector<int> input_shape = {batch_size, 1};
+    if (batch_size == 0)
+        input_shape.erase(input_shape.begin());
+
+    cv::Mat input1 = cv::Mat(input_shape, CV_32F, 1.0);
+    cv::Mat input2 = cv::Mat(input_shape, CV_32F, 1.0);
+    cv::randu(input1, 0.0, 1.0);
+    cv::randu(input2, 0.0, 1.0);
```

Review comment:
Wrong by design. As mentioned by previous comments. There is ambiguous interpretation: - `input_shape={N}` - is 1D array broadcasted between batches? - or `input_shape={N}` - is scalar (0D) specified for N batches?