nareshmlx/opencv-pr huggingface dataset:
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
Ok, then `cvFindExtrinsicCameraParams2` may get good result with 4 points, but may throw Exception with 5 points. I think CV_CheckGE in [`cvFindExtrinsicCameraParams2`](https://github.com/opencv/opencv/blob/863ecded30dcaedff0ece893277411f39bb3c1c6/modules/calib3d/src/calibration.cpp#L1099) is not a good idea. But since it returns void (not bool), throwing Exception may be the only option to inform that the result is bad. As a result, try-catch seems inevitable.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
> Ok, then `cvFindExtrinsicCameraParams2` may get good result with 4 points, but may throw Exception with 5 points. Not sure to follow correctly. In `cvFindExtrinsicCameraParams2` it checks first if the 3D points are coplanar. For coplanar case, it should never throw exception, except theoretically for degenerate cases like all collinear points but this is not handled/detected. And there are already a check for at least 4 points if `useExtrinsicGuess` is false: https://github.com/opencv/opencv/blob/863ecded30dcaedff0ece893277411f39bb3c1c6/modules/calib3d/src/calibration.cpp#L1014
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
`cvFindExtrinsicCameraParams2` does check if the 3D points are coplanar. And if not, it may throw exception. When someone calls `cvFindExtrinsicCameraParams2` directly, he can make sure the input points are more than 4. If he knows that the points may not be coplanar, he can make sure the points are more than 6. In this cases, `cvFindExtrinsicCameraParams2` won't throw exceptions, because the user calls it in the "right" way. However, codes in `solvePnPRansac` does not guarantee that. When the user knows the points used to solve PnP are very likely to be noncoplanar, the only thing he can do is to input as many points as possible (6 at least). But RANSACE procedure (the intermediate calculation) may reduce the points and make them not suitable for `cvFindExtrinsicCameraParams2`. That's why I think Exception here is not supposed to happen. It's NOT the user's fault. To fix this, `solvePnPRansac` should either check the coplanarity before calling `solvePnP`, or call `solvePnP` with try-catch. The former solution may add unnecessary calculation.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
Is it needed since it is used in `CV_LOG_DEBUG`?
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
> 4. / 460.0 Reprojection error is in pixel unit (default value is 8). Wondering if it explains why you only have a consensus set of 5 points?
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
See the buildbot (https://pullrequest.opencv.org/#/summary/opencv) errors. This requires C++11 features.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
I'm not quite sure about this, but I have seen same usage in [calibinit.cpp](https://github.com/opencv/opencv/blob/cac5b0fe5a3e06718a6cb408d6468ff87428ef2a/modules/calib3d/src/calibinit.cpp#L2261-L2266). Maybe in Release build, `CV_LOG_DEBUG` doesn't use `e`, then `CV_UNUSED` can supress the warning?
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
In my test data, the 2D points are from the normalized image coordiante system, that's why the camera matrix is `Mat::eye(3, 3, CV_64FC1)`. So, the reprojection error here is not in pixel unit. As you can see, the focal length of my camera is about 460.0, and the tolerance of reprojection error is set to 4 pixels. It should be fine.
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
Fixed now.
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
You are right. I did not see that the camera matrix is identity.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
Yes, I think that it is to probably suppress warning in release mode.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 
     opoints_inliers.resize(npoints1);
     ipoints_inliers.resize(npoints1);
-    result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
-                      distCoeffs, rvec, tvec, useExtrinsicGuess,
-                      (flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P) ? SOLVEPNP_EPNP : flags) ? 1 : -1;
+    try
+    {
+        result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
```

Review comment:
Maybe something like this? This is to explain to the user that everything went fine (consensus set was found that agree with the hypothesis), but issue occurs when computing the final pose using all the points in the consensus set. ```suggestion CV_LOG_DEBUG(NULL, "solvePnPRansac(): solvePnP stage to compute the final pose using points in the consensus set failed, use result from MSS (Minimal Sample Sets) stage instead:\n" << e.what()); ```
**File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points

**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
     EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
 }
 
+TEST(Calib3d_SolvePnPRansac, bad_input_points_19253)
+{
+    // with this specific data
+    // when computing the final pose using points in the consensus set with SOLVEPNP_ITERATIVE and solvePnP()
+    // an exception is thrown from solvePnP because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points
+    // with PR #19253 we choose to return true, with the pose estimated from the MSS stage instead of throwing the exception
```

Review comment:
I would add some comments before this line to explain this test: - with this specific data - when computing the final pose using points in the consensus set with `SOLVEPNP_ITERATIVE` and `solvePnP()` - an exception is thrown from `solvePnP` because there are 5 non-coplanar 3D points and the DLT algorithm needs at least 6 non-coplanar 3D points - with PR #19253 we choose to return `true`, with the pose estimated from the MSS stage instead of throwing the exception
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326

**Code Changes:**
```diff
+    {
+        if (flags == SOLVEPNP_ITERATIVE &&
+            npoints1 == 5 &&
+            e.what() &&
+            std::string(e.what()).find("DLT algorithm needs at least 6 points") != std::string::npos
+        )
+        {
+            CV_LOG_INFO(NULL, "solvePnPRansac(): solvePnP stage to compute the final pose using points "
+                "in the consensus set raised DLT 6 points exception, use result from MSS (Minimal Sample Sets) stage instead.");
+            rvec = _local_model.col(0);    // output rotation vector
+            tvec = _local_model.col(1);    // output translation vector
```

Review comment:
This part changes behavior of the case which is not covered by PR's description: - `result = solvePnP()` doesn't throw exception - it returns `result <= 0` Alternative #19492 preserves behavior of non-exception case. --- > When I call solvePnPRansac with 69 points (data I provided above), then I should get a result (even if it's false) rather than an Exception. `false` code path is changed. > solvePnPRansac returns true even if the solvePnP stage failed. In this case, result from MSS stage is taken, and the exception content from solvePnP is put into log. Only exception's case is logged, but returned value is forced "true" for other cases too.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326

**Code Changes:**
```diff
+    {
+        if (flags == SOLVEPNP_ITERATIVE &&
+            npoints1 == 5 &&
+            e.what() &&
+            std::string(e.what()).find("DLT algorithm needs at least 6 points") != std::string::npos
+        )
+        {
+            CV_LOG_INFO(NULL, "solvePnPRansac(): solvePnP stage to compute the final pose using points "
+                "in the consensus set raised DLT 6 points exception, use result from MSS (Minimal Sample Sets) stage instead.");
+            rvec = _local_model.col(0);    // output rotation vector
+            tvec = _local_model.col(1);    // output translation vector
```

Review comment:
You are right, the logging strategy here is problematic.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326

**Code Changes:**
```diff
+    {
+        if (flags == SOLVEPNP_ITERATIVE &&
+            npoints1 == 5 &&
+            e.what() &&
+            std::string(e.what()).find("DLT algorithm needs at least 6 points") != std::string::npos
+        )
+        {
+            CV_LOG_INFO(NULL, "solvePnPRansac(): solvePnP stage to compute the final pose using points "
+                "in the consensus set raised DLT 6 points exception, use result from MSS (Minimal Sample Sets) stage instead.");
+            rvec = _local_model.col(0);    // output rotation vector
+            tvec = _local_model.col(1);    // output translation vector
```

Review comment:
Main question is about the final returned value. |result = solvePnP|(1) existed code|(2) This PR| (3) PR 19492|case4(no PR) |---|---|---|---|---| |result > 0|true|true|true|true| |result<=0|false|true (&#x2753;) |false|false| |exception|exception|true (&#x2753;)|true (&#x2753;)| false|
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326

**Code Changes:**
```diff
+    {
+        if (flags == SOLVEPNP_ITERATIVE &&
+            npoints1 == 5 &&
+            e.what() &&
+            std::string(e.what()).find("DLT algorithm needs at least 6 points") != std::string::npos
+        )
+        {
+            CV_LOG_INFO(NULL, "solvePnPRansac(): solvePnP stage to compute the final pose using points "
+                "in the consensus set raised DLT 6 points exception, use result from MSS (Minimal Sample Sets) stage instead.");
+            rvec = _local_model.col(0);    // output rotation vector
+            tvec = _local_model.col(1);    // output translation vector
```

Review comment:
I think you meant to @ someone else (not me)?
**File:** modules/core/src/matrix_sparse.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard
**Review Line:** 174

**Code Changes:**
```diff
@@ -171,7 +171,14 @@ void SparseMat::Hdr::clear()
     hashtab.clear();
     hashtab.resize(HASH_SIZE0);
     pool.clear();
+#if defined(__GNUC__)  && (__GNUC__ == 13) && !defined(__clang__) && (__cplusplus >= 202002L)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
     pool.resize(nodeSize);
+#if defined(__GNUC__)  && (__GNUC__ == 13) && !defined(__clang__) && (__cplusplus >= 202002L)
```

Review comment:
It's not safe replacement. Pool elements cannot be used after it, but they could be before.
**File:** modules/imgproc/test/test_filter.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard

**Code Changes:**
```diff
@@ -1865,107 +1865,65 @@ TEST(Imgproc_PreCornerDetect, accuracy) { CV_PreCornerDetectTest test; test.safe
 TEST(Imgproc_Integral, accuracy) { CV_IntegralTest test; test.safe_run(); }
 
 //////////////////////////////////////////////////////////////////////////////////
-
-class CV_FilterSupportedFormatsTest : public cvtest::BaseTest
-{
-public:
-    CV_FilterSupportedFormatsTest() {}
-    ~CV_FilterSupportedFormatsTest() {}
```

Review comment:
What issue does it solve? I prefer the original version.
**File:** modules/imgproc/test/test_filter.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard

**Code Changes:**
```diff
@@ -1865,107 +1865,65 @@ TEST(Imgproc_PreCornerDetect, accuracy) { CV_PreCornerDetectTest test; test.safe
 TEST(Imgproc_Integral, accuracy) { CV_IntegralTest test; test.safe_run(); }
 
 //////////////////////////////////////////////////////////////////////////////////
-
-class CV_FilterSupportedFormatsTest : public cvtest::BaseTest
-{
-public:
-    CV_FilterSupportedFormatsTest() {}
-    ~CV_FilterSupportedFormatsTest() {}
```

Review comment:
Perhaps this test should be rewritten using `ASSERT/EXPECT_NO_THROW` and `SCOPED_TRACE` :slightly_smiling_face:
**File:** modules/imgproc/src/generalized_hough.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard

**Code Changes:**
```diff
@@ -692,7 +692,11 @@ namespace
         getContourPoints(edges, dx, dy, points);
 
         features.resize(levels_ + 1);
-        std::for_each(features.begin(), features.end(), [=](std::vector<Feature>& e) { e.clear(); e.reserve(maxBufferSize_); });
+        const size_t maxBufferSize = maxBufferSize_;
+        std::for_each(features.begin(), features.end(), [maxBufferSize](std::vector<Feature>& e) {
+            e.clear();
+            e.reserve(maxBufferSize);
+        });
```

Review comment:
I think lambda capture list should be kept as small as possible. If compatibility with C++11 should be preserved, then ```suggestion const size_t maxBufferSize = maxBufferSize_; std::for_each(features.begin(), features.end(), [maxBufferSize](std::vector<Feature>& e) { e.clear(); e.reserve(maxBufferSize); }); ``` otherwise for C++14 ```c++ std::for_each(features.begin(), features.end(), [maxBufferSize = maxBufferSize_](std::vector<Feature>& e) { e.clear(); e.reserve(maxBufferSize); }); ```
**File:** samples/dnn/gpt2_inference.py
**Change Type:** modified
**Context:** PR #26584: Update printingin GPT2 sample

**Code Changes:**
```diff
@@ -30,21 +30,17 @@
     python gpt2_inference.py --model=<path-to-onnx-model>  --prompt=<use-promt-of-the-same-length-used-while-exporting>
 '''
 
-
-
 import numpy as np
 import tiktoken
 import argparse
 import cv2 as cv
```

Review comment:
I propose to raise the limitation up to 1000 tockens or more.
**File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples

**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>
+#include "common.hpp"
+
```

Review comment:
The path of the models are confusing. Warning messages require setting `OPENCV_SAMPLES_DATA_PATH` or `OPENCV_DOWNLOAD_CACHE_DIR`; when `OPENCV_SAMPLES_DATA_PATH` is set, another warning appear: FileNotFoundError: File xxxx not found! Please specify the path to /opencv/samples/data in the OPENCV_SAMPLES_DATA_PATH environment variable, or specify the path to opencv_extra/testdata in the OPENCV_DNN_TEST_DATA_PATH environment variable, or specify the path to the model download cache directory in the OPENCV_DOWNLOAD_CACHE_DIR environment variable, or pass the full path to xxxx.
**File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples

**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>
+#include "common.hpp"
+
```

Review comment:
Such main does not make a lot of sense. I propose to rename "run" to "main" and remove it.
**File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples

**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>
+#include "common.hpp"
+
```

Review comment:
Why do you use 100 here?
**File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples

**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>
+#include "common.hpp"
+
```

Review comment:
yes, 100ms is too long delay. Should be decreased to 10.