nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -50,6 +50,7 @@ static inline bool readWrite(DetectorParameters &params, const FileNode* readNod
                                 readNode, writeStorage);
     check |= readWriteParameter("minOtsuStdDev", params.minOtsuStdDev, readNode, writeStorage);
     check |= readWriteParameter("errorCorrectionRate", params.errorCorrectionRate, readNode, writeStorage);
+    check |= readWriteParameter("minGroupDistance", params.minGroupDistance, readNode, writeStorage);
     // new aruco 3 functionality
     check |= readWriteParameter("useAruco3Detection", params.useAruco3Detection, readNode, writeStorage);
     check |= readWriteParameter("minSideLengthCanonicalImg", params.minSideLengthCanonicalImg, readNode, writeStorage);
@@ -212,149 +213,65 @@ static void _reorderCandidatesCorners(vector<vector<Point2f> > &candidates) {
     }
```

Review comment:
added `groupedCandidates.push_back({i, j});` emplace_back no compiling
**File:** doc/pattern_tools/test_charuco_board.py
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 37

**Code Changes:**
```diff
@@ -34,7 +34,7 @@ def test_aruco_dicts(self):
                 aruco_dict = cv.aruco.getPredefinedDictionary(aruco_type[aruco_type_i])
                 board = cv.aruco.CharucoBoard((cols, rows), square_size, marker_size, aruco_dict)
                 charuco_detector = cv.aruco.CharucoDetector(board)
-                from_cv_img = board.generateImage((cols*square_size*10, rows*square_size*10))
+                from_cv_img = board.generateImage((cols*square_size, rows*square_size))
 
                 #draw desk using svg
                 fd1, filesvg = tempfile.mkstemp(prefix="out", suffix=".svg")
@@ -50,15 +50,20 @@ def test_aruco_dicts(self):
                     pm.make_charuco_board()
```

Review comment:
reduced the dimension of the test
**File:** doc/pattern_tools/test_charuco_board.py
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 53

**Code Changes:**
```diff
@@ -50,15 +50,20 @@ def test_aruco_dicts(self):
                     pm.make_charuco_board()
                     pm.save()
                     drawing = svg2rlg(filesvg)
-                    renderPM.drawToFile(drawing, filepng, fmt='PNG', dpi=720)
+                    renderPM.drawToFile(drawing, filepng, fmt='PNG', dpi=72)
                     from_svg_img = cv.imread(filepng)
+                    _charucoCorners, _charuco_ids_svg, marker_corners_svg, marker_ids_svg = charuco_detector.detectBoard(from_svg_img)
+                    _charucoCorners, _charuco_ids_cv, marker_corners_cv, marker_ids_cv = charuco_detector.detectBoard(from_cv_img)
+                    marker_corners_svg_map, marker_corners_cv_map = {}, {}
+                    for i in range(len(marker_ids_svg)):
```

Review comment:
reduced the dimension of the test
**File:** doc/pattern_tools/test_charuco_board.py
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 61

**Code Changes:**
```diff
+                    _charucoCorners, _charuco_ids_cv, marker_corners_cv, marker_ids_cv = charuco_detector.detectBoard(from_cv_img)
+                    marker_corners_svg_map, marker_corners_cv_map = {}, {}
+                    for i in range(len(marker_ids_svg)):
+                        marker_corners_svg_map[int(marker_ids_svg[i][0])] = marker_corners_svg[i]
+                    for i in range(len(marker_ids_cv)):
+                        marker_corners_cv_map[int(marker_ids_cv[i][0])] = marker_corners_cv[i]
 
-                    #test
-                    _charucoCorners, _charucoIds, markerCorners_svg, markerIds_svg = charuco_detector.detectBoard(from_svg_img)
-                    _charucoCorners, _charucoIds, markerCorners_cv, markerIds_cv = charuco_detector.detectBoard(from_cv_img)
-
```

Review comment:
added sorting of returned markers
**File:** doc/pattern_tools/test_charuco_board.py
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 120

**Code Changes:**
```diff
+                    _charucoCorners, _charuco_ids_cv, marker_corners_cv, marker_ids_cv = charuco_detector.detectBoard(from_cv_img)
+                    marker_corners_svg_map, marker_corners_cv_map = {}, {}
+                    for i in range(len(marker_ids_svg)):
+                        marker_corners_svg_map[int(marker_ids_svg[i][0])] = marker_corners_svg[i]
+                    for i in range(len(marker_ids_cv)):
+                        marker_corners_cv_map[int(marker_ids_cv[i][0])] = marker_corners_cv[i]
 
-                    np.testing.assert_allclose(markerCorners_svg, markerCorners_cv, 0.1, 0.1)
-                    np.testing.assert_allclose(markerIds_svg, markerIds_cv, 0.1, 0.1)
+                    for key_svg in marker_corners_svg_map.keys():
+                        marker_svg = marker_corners_svg_map[key_svg]
```

Review comment:
added sorting of returned markers
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -33,7 +33,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
         polygonalApproxAccuracyRate = 0.03;
         minCornerDistanceRate = 0.05;
         minDistanceToBorder = 3;
-        minMarkerDistanceRate = 0.05;
+        minMarkerDistanceRate = 0.125;
         cornerRefinementMethod = (int)CORNER_REFINE_NONE;
         cornerRefinementWinSize = 5;
         relativeCornerRefinmentWinSize = 0.3f;
@@ -100,12 +100,26 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
```

Review comment:
"imilar" - typo.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -33,7 +33,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
         polygonalApproxAccuracyRate = 0.03;
         minCornerDistanceRate = 0.05;
         minDistanceToBorder = 3;
-        minMarkerDistanceRate = 0.05;
+        minMarkerDistanceRate = 0.125;
         cornerRefinementMethod = (int)CORNER_REFINE_NONE;
         cornerRefinementWinSize = 5;
         relativeCornerRefinmentWinSize = 0.3f;
@@ -100,12 +100,26 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
```

Review comment:
Please mention OpenCV version when the default value was changed and what happened.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -50,6 +50,7 @@ static inline bool readWrite(DetectorParameters &params, const FileNode* readNod
                                 readNode, writeStorage);
     check |= readWriteParameter("minOtsuStdDev", params.minOtsuStdDev, readNode, writeStorage);
     check |= readWriteParameter("errorCorrectionRate", params.errorCorrectionRate, readNode, writeStorage);
+    check |= readWriteParameter("minGroupDistance", params.minGroupDistance, readNode, writeStorage);
     // new aruco 3 functionality
     check |= readWriteParameter("useAruco3Detection", params.useAruco3Detection, readNode, writeStorage);
     check |= readWriteParameter("minSideLengthCanonicalImg", params.minSideLengthCanonicalImg, readNode, writeStorage);
@@ -212,149 +213,65 @@ static void _reorderCandidatesCorners(vector<vector<Point2f> > &candidates) {
     }
```

Review comment:
I propose to use size_t with `ncandidaates` and `counter`. No need in type casts then.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -50,6 +50,7 @@ static inline bool readWrite(DetectorParameters &params, const FileNode* readNod
                                 readNode, writeStorage);
     check |= readWriteParameter("minOtsuStdDev", params.minOtsuStdDev, readNode, writeStorage);
     check |= readWriteParameter("errorCorrectionRate", params.errorCorrectionRate, readNode, writeStorage);
+    check |= readWriteParameter("minGroupDistance", params.minGroupDistance, readNode, writeStorage);
     // new aruco 3 functionality
     check |= readWriteParameter("useAruco3Detection", params.useAruco3Detection, readNode, writeStorage);
     check |= readWriteParameter("minSideLengthCanonicalImg", params.minSideLengthCanonicalImg, readNode, writeStorage);
@@ -212,149 +213,65 @@ static void _reorderCandidatesCorners(vector<vector<Point2f> > &candidates) {
     }
```

Review comment:
I propose to use `size_t i` and drop type cast.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 786

**Code Changes:**
```diff
+        vector<int> rotated(ncandidates, 0);
+        vector<uint8_t> validCandidates(ncandidates, 0);
+        vector<bool> was(ncandidates, false);
+        bool checkCloseContours = true;
+
+        int maxDepth = 0;
+        for (size_t i = 0ull; i < selectedContours.size(); i++)
+            maxDepth = max(selectedContours[i].depth, maxDepth);
+        vector<vector<size_t>> depths(maxDepth+1);
+        for (size_t i = 0ull; i < selectedContours.size(); i++) {
+            depths[selectedContours[i].depth].push_back(i);
```

Review comment:
Are you sure that initial value is valid? If I understood correctly .depth >= 0. Then `if (maxDepth < selectedContours[i].depth)` is always false.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 795

**Code Changes:**
```diff
+        for (size_t i = 0ull; i < selectedContours.size(); i++) {
+            depths[selectedContours[i].depth].push_back(i);
+        }
+
+        //// Analyze each of the candidates
+        int depth = 0;
+        size_t counter = 0;
+        while (counter < ncandidates) {
+            parallel_for_(Range(0, (int)depths[depth].size()), [&](const Range& range) {
+                const int begin = range.start;
+                const int end = range.end;
```

Review comment:
I propose to rename it to `depthIdx` or `depthId` as it's not a "depth" value, but index.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 233

**Code Changes:**
```diff
-                    if(candGroup[i]<0 && candGroup[j]<0){
-                        // mark candidates with their corresponding group number
-                        candGroup[i] = candGroup[j] = (int)groupedCandidates.size();
+struct MarkerCandidate {
+    vector<Point2f> corners;
+    vector<Point> contour;
+    float perimeter = 0.f;
+};
 
-                        // create group
-                        vector<unsigned int> grouped;
```

Review comment:
Discussed offline. Found out that original idea with `std::move` works.
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 786

**Code Changes:**
```diff
+        vector<int> rotated(ncandidates, 0);
+        vector<uint8_t> validCandidates(ncandidates, 0);
+        vector<bool> was(ncandidates, false);
+        bool checkCloseContours = true;
+
+        int maxDepth = 0;
+        for (size_t i = 0ull; i < selectedContours.size(); i++)
+            maxDepth = max(selectedContours[i].depth, maxDepth);
+        vector<vector<size_t>> depths(maxDepth+1);
+        for (size_t i = 0ull; i < selectedContours.size(); i++) {
+            depths[selectedContours[i].depth].push_back(i);
```

Review comment:
``` int maxDepth = 0; for (size_t i = 0ull; i < selectedContours.size(); i++) { if (maxDepth < selectedContours[i].depth) maxDepth = selectedContours[i].depth; } ``` depth is vertex depth in the tree, depth is the distance from the root maxDepth is searched correctly, I can use a simpler code: `maxDepth = max(selectedContours[i].depth, maxDepth);`
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -50,6 +50,7 @@ static inline bool readWrite(DetectorParameters &params, const FileNode* readNod
                                 readNode, writeStorage);
     check |= readWriteParameter("minOtsuStdDev", params.minOtsuStdDev, readNode, writeStorage);
     check |= readWriteParameter("errorCorrectionRate", params.errorCorrectionRate, readNode, writeStorage);
+    check |= readWriteParameter("minGroupDistance", params.minGroupDistance, readNode, writeStorage);
     // new aruco 3 functionality
     check |= readWriteParameter("useAruco3Detection", params.useAruco3Detection, readNode, writeStorage);
     check |= readWriteParameter("minSideLengthCanonicalImg", params.minSideLengthCanonicalImg, readNode, writeStorage);
@@ -212,149 +213,65 @@ static void _reorderCandidatesCorners(vector<vector<Point2f> > &candidates) {
     }
```

Review comment:
added: `size_t ncandidates = selectedContours.size();`
**File:** modules/objdetect/src/aruco/aruco_detector.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 795

**Code Changes:**
```diff
+        for (size_t i = 0ull; i < selectedContours.size(); i++) {
+            depths[selectedContours[i].depth].push_back(i);
+        }
+
+        //// Analyze each of the candidates
+        int depth = 0;
+        size_t counter = 0;
+        while (counter < ncandidates) {
+            parallel_for_(Range(0, (int)depths[depth].size()), [&](const Range& range) {
+                const int begin = range.start;
+                const int end = range.end;
```

Review comment:
in this case, "depth" is a value and an index at the same time
**File:** modules/objdetect/test/test_arucodetection.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -613,6 +613,32 @@ TEST(CV_ArucoDetectMarkers, regression_2492)
     }
 }
 
+
+TEST(CV_ArucoDetectMarkers, regression_contour_24220)
+{
+    aruco::ArucoDetector detector;
+    vector<int> markerIds;
+    vector<vector<Point2f> > markerCorners;
```

Review comment:
The two lines useless. They do not change detector behavior.
**File:** modules/objdetect/test/test_arucodetection.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -613,6 +613,32 @@ TEST(CV_ArucoDetectMarkers, regression_2492)
     }
 }
 
+
+TEST(CV_ArucoDetectMarkers, regression_contour_24220)
+{
+    aruco::ArucoDetector detector;
+    vector<int> markerIds;
+    vector<vector<Point2f> > markerCorners;
```

Review comment:
N==1 loop is not needed.
**File:** modules/objdetect/test/test_arucodetection.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -613,6 +613,32 @@ TEST(CV_ArucoDetectMarkers, regression_2492)
     }
 }
 
+
+TEST(CV_ArucoDetectMarkers, regression_contour_24220)
+{
+    aruco::ArucoDetector detector;
+    vector<int> markerIds;
+    vector<vector<Point2f> > markerCorners;
```

Review comment:
The same for loop
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco
**Review Line:** 112

**Code Changes:**
```diff
+     * min(MarkerPerimeter1, MarkerPerimeter2)*minMarkerDistanceRate.
+     *
+     * default value is 0.125 because 0.125*MarkerPerimeter = (MarkerPerimeter / 4) * 0.5 = half the side of the marker.
+     *
+     * @note default value was changed from 0.05 after 4.8.1 release, because the filtering algorithm has been changed.
+     * Now a few candidates from the same group can be added to the list of candidates if they are far from each other.
+     * @sa minGroupDistance.
      */
     CV_PROP_RW double minMarkerDistanceRate;
 
+    /** @brief minimum average distance between the corners of the two markers in group to add them to the list of candidates
```

Review comment:
I suspect that under "marker" you mean single cell of Aruco marker, but not full marker. I propose to use word "pin" something else. Otherwise it confuses reader.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -33,7 +33,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
         polygonalApproxAccuracyRate = 0.03;
         minCornerDistanceRate = 0.05;
         minDistanceToBorder = 3;
-        minMarkerDistanceRate = 0.05;
+        minMarkerDistanceRate = 0.125;
         cornerRefinementMethod = (int)CORNER_REFINE_NONE;
         cornerRefinementWinSize = 5;
         relativeCornerRefinmentWinSize = 0.3f;
@@ -100,12 +100,26 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
```

Review comment:
added info
**File:** modules/objdetect/test/test_arucodetection.cpp
**Change Type:** modified
**Context:** PR #24479: Fix contour filtering in ArUco

**Code Changes:**
```diff
@@ -613,6 +613,32 @@ TEST(CV_ArucoDetectMarkers, regression_2492)
     }
 }
 
+
+TEST(CV_ArucoDetectMarkers, regression_contour_24220)
+{
+    aruco::ArucoDetector detector;
+    vector<int> markerIds;
+    vector<vector<Point2f> > markerCorners;
```

Review comment:
removed map and N==1 loop
**File:** modules/core/include/opencv2/core/fast_math.hpp
**Change Type:** modified
**Context:** PR #24495: Get the SSE2 condition match the emmintrin.h inclusion condition.

**Code Changes:**
```diff
@@ -68,7 +68,7 @@
   // nothing, intrinsics/asm code is not supported
 #else
   #if ((defined _MSC_VER && defined _M_X64) \
-      || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__)) \
+      || (defined __GNUC__ && defined __SSE2__)) \
       && !defined(OPENCV_SKIP_INCLUDE_EMMINTRIN_H)
     #include <emmintrin.h>
   #endif
```

Review comment:
Condition of include should be changed instead.
**File:** modules/core/include/opencv2/core/fast_math.hpp
**Change Type:** modified
**Context:** PR #24495: Get the SSE2 condition match the emmintrin.h inclusion condition.

**Code Changes:**
```diff
@@ -68,7 +68,7 @@
   // nothing, intrinsics/asm code is not supported
 #else
   #if ((defined _MSC_VER && defined _M_X64) \
-      || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__)) \
+      || (defined __GNUC__ && defined __SSE2__)) \
       && !defined(OPENCV_SKIP_INCLUDE_EMMINTRIN_H)
     #include <emmintrin.h>
   #endif
```

Review comment:
I actually was wondering whether it made sense to check for __x86_64__ AND __SSE2__. Done
**File:** modules/dnn/perf/perf_einsum.cpp
**Change Type:** added
**Context:** PR #24445: Einsum Layer Performance Test

**Code Changes:**
```diff
@@ -0,0 +1,123 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "perf_precomp.hpp"
+
+namespace opencv_test {
+
+struct EinsumParams {
```

Review comment:
Please remove \t, \n. `where GetParam() =` goes to performance report and breaks comparison reports. It should be one-line string.
**File:** modules/dnn/perf/perf_einsum.cpp
**Change Type:** added
**Context:** PR #24445: Einsum Layer Performance Test

**Code Changes:**
```diff
@@ -0,0 +1,123 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "perf_precomp.hpp"
+
+namespace opencv_test {
+
+struct EinsumParams {
```

Review comment:
The same here. I propose alternative format like `InputShape={{1, 4,70, 90}, {1, 5, 90, 80}}`
**File:** modules/dnn/perf/perf_einsum.cpp
**Change Type:** added
**Context:** PR #24445: Einsum Layer Performance Test

**Code Changes:**
```diff
@@ -0,0 +1,123 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "perf_precomp.hpp"
+
+namespace opencv_test {
+
+struct EinsumParams {
```

Review comment:
It makes sense to add couple of odd sizes like 127 or 113. It's usually hardest case for optimization and it shows the worst scenario.
**File:** modules/dnn/perf/perf_einsum.cpp
**Change Type:** added
**Context:** PR #24445: Einsum Layer Performance Test

**Code Changes:**
```diff
@@ -0,0 +1,123 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "perf_precomp.hpp"
+
+namespace opencv_test {
+
+struct EinsumParams {
```

Review comment:
New line before end of file.
**File:** modules/videoio/test/test_video_io.cpp
**Change Type:** modified
**Context:** PR #24243: Fix gstreamer backend with manual pipelines
**Review Line:** 249

**Code Changes:**
```diff
             if (cvtest::debugLevel > 0)
                 std::cout << "i = " << i << ": timestamp = " << timestamp << std::endl;
             const double frame_period = 1000.f/bunny_param.getFps();
+            // big_buck_bunny.mpg starts at 0.500 msec
+            if ((ext == "mpg") && (apiPref == CAP_GSTREAMER))
+                timestamp -= 500.0;
             // NOTE: eps == frame_period, because videoCapture returns frame beginning timestamp or frame end
             // timestamp depending on codec and back-end. So the first frame has timestamp 0 or frame_period.
             EXPECT_NEAR(timestamp, i*frame_period, frame_period) << "i=" << i;
```

Review comment:
Could you add explanation fro the GStreamer hack. Looks very strange.
**File:** modules/videoio/test/test_video_io.cpp
**Change Type:** modified
**Context:** PR #24243: Fix gstreamer backend with manual pipelines
**Review Line:** 249

**Code Changes:**
```diff
             if (cvtest::debugLevel > 0)
                 std::cout << "i = " << i << ": timestamp = " << timestamp << std::endl;
             const double frame_period = 1000.f/bunny_param.getFps();
+            // big_buck_bunny.mpg starts at 0.500 msec
+            if ((ext == "mpg") && (apiPref == CAP_GSTREAMER))
+                timestamp -= 500.0;
             // NOTE: eps == frame_period, because videoCapture returns frame beginning timestamp or frame end
             // timestamp depending on codec and back-end. So the first frame has timestamp 0 or frame_period.
             EXPECT_NEAR(timestamp, i*frame_period, frame_period) << "i=" << i;
```

Review comment:
Especially, it is the correct behavior if we can trust other tools. ffprobe reports for big_buck_bunny.mpg: ```bash Input #0, mpeg, from 'big_buck_bunny.mpg': Duration: 00:00:05.08, start: 0.500000, bitrate: 580 kb/s Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 672x384 [SAR 1:1 DAR 7:4], 104857 kb/s, 24 fps, 24 tbr, 90k tbn, 24 tbc ```` This video starts at 500 msec.
**File:** modules/videoio/src/cap_gstreamer.cpp
**Change Type:** modified
**Context:** PR #24243: Fix gstreamer backend with manual pipelines
**Review Line:** 1549

**Code Changes:**
```diff
@@ -1534,14 +1545,16 @@ bool GStreamerCapture::open(const String &filename_, const cv::VideoCaptureParam
 
         if (videoStream >= 0)
         {
+            queue.reset(gst_element_factory_make("queue", NULL));
+            CV_Assert(queue);
             sink.reset(gst_element_factory_make("appsink", NULL));
             CV_Assert(sink);
             // videoconvert (in 0.10: ffmpegcolorspace, in 1.x autovideoconvert)
             //automatically selects the correct colorspace conversion based on caps.
             color.reset(gst_element_factory_make(COLOR_ELEM, NULL));
```

Review comment:
Why do you add queue to the pipeline?