nareshmlx/opencv-pr huggingface dataset:
**File:** modules/gapi/perf/common/gapi_render_perf_tests.hpp
**Change Type:** added
**Context:** PR #16772: Added g-api render performance tests

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// 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.
+//
+// Copyright (C) 2020 Intel Corporation
+
+
+#ifndef OPENCV_GAPI_RENDER_PERF_TESTS_HPP
+#define OPENCV_GAPI_RENDER_PERF_TESTS_HPP
```

Review comment:
Why do you can't pass final value without calling extra conversion helpers?
**File:** modules/gapi/perf/common/gapi_render_perf_tests.hpp
**Change Type:** added
**Context:** PR #16772: Added g-api render performance tests

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// 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.
+//
+// Copyright (C) 2020 Intel Corporation
+
+
+#ifndef OPENCV_GAPI_RENDER_PERF_TESTS_HPP
+#define OPENCV_GAPI_RENDER_PERF_TESTS_HPP
```

Review comment:
Like this: `str = L"hello, world!` ?
**File:** modules/calib3d/src/usac.hpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,800 @@
+// 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.
+
+#ifndef OPENCV_USAC_USAC_HPP
+#define OPENCV_USAC_USAC_HPP
+
+namespace cv { namespace usac {
+enum EstimationMethod { Homography, Fundamental, Fundamental8, Essential, Affine, P3P, P6P};
```

Review comment:
`bool isBetter()`, like `isInlier()` below.
**File:** modules/calib3d/src/usac.hpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,800 @@
+// 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.
+
+#ifndef OPENCV_USAC_USAC_HPP
+#define OPENCV_USAC_USAC_HPP
+
+namespace cv { namespace usac {
+enum EstimationMethod { Homography, Fundamental, Fundamental8, Essential, Affine, P3P, P6P};
```

Review comment:
width/height => Size?
**File:** modules/calib3d/src/usac/homography_solver.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,445 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#ifdef HAVE_EIGEN
+#include <Eigen/Eigen>
+#endif
```

Review comment:
License headers including external references should be placed in the file header (before any code)
**File:** modules/calib3d/src/usac/termination.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,378 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+
+namespace cv { namespace usac {
+////////////////////////////////// STANDARD TERMINATION ///////////////////////////////////////////
```

Review comment:
IMHO, we should not introduce such time-based limits as part of OpenCV. - no way to provide reliable testing of algorithms with such criteria (running tests in parallel on heavy load machine, mobile phones or embedded devices can get different results, etc) - use number of iterations instead - provide to API to configure this in User application. - time measuring/querying on each iteration can introduce unnecessary overhead
**File:** modules/calib3d/src/usac/utils.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,526 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#include "opencv2/flann/miniflann.hpp"
+#include <map>
+
```

Review comment:
What is about `cv::randShuffle()`?
**File:** modules/calib3d/src/usac/utils.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,526 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#include "opencv2/flann/miniflann.hpp"
+#include <map>
+
```

Review comment:
`MatCommaInitializer` has poor performance and bloats binary code. Consider using of `Mat33d` directly.
**File:** modules/calib3d/src/usac/utils.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,526 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#include "opencv2/flann/miniflann.hpp"
+#include <map>
+
```

Review comment:
C asserts are forbidden in OpenCV. Use `CV_Assert()` instead (or better CV_Check* macros).
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Use check from Google Tests instead.
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
avoid indentation in namespaces
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Use seed from OpenCV test suite (or `cv::theRNG()`). Totally random numbers must be avoided in OpenCV test - tests must be reproducible. We must avoid expanding set of tests with sporadic failures.
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Are `inliers` doubles? Why?
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
use EXPECT_GT or ASSERT_GT
**File:** modules/calib3d/src/usac/homography_solver.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,445 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#ifdef HAVE_EIGEN
+#include <Eigen/Eigen>
+#endif
```

Review comment:
moved this license to usac.hpp
**File:** modules/calib3d/src/usac/termination.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,378 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+
+namespace cv { namespace usac {
+////////////////////////////////// STANDARD TERMINATION ///////////////////////////////////////////
```

Review comment:
fixed. Now, RANSAC terminates when maximum number iterations exceed
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Because I use doubles for ground truth rotation and calibration otherwise I would have error in matrix multiplication. Since it is just test files I want to have higher precision. My RANSAC is using float points. Also in new commit (in test file) I save indices of ground truth inliers as integers.
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 207

**Code Changes:**
```diff
@@ -201,6 +203,11 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 {
     CV_INSTRUMENT_REGION();
 
+    if (flags >= 32 && flags <= 38)
+        return usac::solvePnPRansac(_opoints, _ipoints, _cameraMatrix, _distCoeffs,
+            _rvec, _tvec, useExtrinsicGuess, iterationsCount, reprojectionError,
+            confidence, _inliers, flags);
+
     Mat opoints0 = _opoints.getMat(), ipoints0 = _ipoints.getMat();
     Mat opoints, ipoints;
```

Review comment:
Wondering if it is planned to improve the whole `solvePnPRansac` logic or if you know a good logic that could be used? I am referring to this topic: #8782 --- From memory and from reading quickly what I wrote: - default behavior uses EPnP to compute the solution for the Minimal Sample Sets (MSS) using 5 points - I thought that the point of RANSAC is to use the minimal number of points so 4 points for pose estimation - but probably it was done like this because EPnP works well with good number of points, wondering if it is starting from 6 points EPnP works well? - good luck to understand the behavior of the function if you change the PnP method Also: - intuitively, I think P3P methods should be used for MSS step since they can produce at most 4 possible solutions with 3 points - so what about using AP3P for MSS? Gao P3P will give bad results due to not handling all [degenerate cases](https://github.com/opencv/opencv/blob/dbab8d8c3897040f134af7195e130dbfcdc2c065/modules/calib3d/src/p3p.cpp#L221) - in general, I would add explicitly the PnP method for MSS and for the final pose computation - because in the present case it gives something like this: ![image](https://user-images.githubusercontent.com/8229425/89507204-7d143d00-d7cc-11ea-938b-bab8beb32a4a.png)
**File:** modules/calib3d/src/usac/dls_solver.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 50

**Code Changes:**
```diff
+#include "opencv_lapack.h"
+#endif
+
+namespace cv { namespace usac {
+// This is the estimator class for estimating a homography matrix between two images. A model estimation method and error calculation method are implemented
+class DLSPnPImpl : public DLSPnP {
+private:
+    const Mat * points_mat, * calib_norm_points_mat, * K_mat;
+#if defined(HAVE_LAPACK) || defined(HAVE_EIGEN)
+    const Mat &K;
+    const float * const calib_norm_points, * const points;
```

Review comment:
Wondering if it is planned to use this DLS implementation for `solvePnP`and related functions? Because currently, when using `SOLVEPNP_DLS` flags, the OpenCV code will silently use EPnP instead: - [Ignoring the flags of solvePnP and silently executing EPNP #5065](https://github.com/opencv/opencv/issues/5065) - [see also](https://github.com/opencv/opencv/pull/6864#issuecomment-473450679) - unfortunately, printing an error message seems to not be an option, so adding a LOG entry? More than 5 years later, there are less than 5 complaints I think. Somehow. I would still update the doc to explicitly mention that you cannot use `SOLVEPNP_UPNP` and `SOLVEPNP_DLS`. Because for now, there is just a small note in the doc. Since nobody will carefully read the doc, I would update the doc: ![image](https://user-images.githubusercontent.com/8229425/89508355-1b54d280-d7ce-11ea-9532-c6c5e4bf95f6.png) to add a bold mention that you cannot use `SOLVEPNP_UPNP` and `SOLVEPNP_DLS`. Or better remove these entries to not advertise these methods. Similarly: ![image](https://user-images.githubusercontent.com/8229425/89508511-4ccd9e00-d7ce-11ea-9d2f-931a9045ba1b.png) Add a bold mention that you cannot use `SOLVEPNP_UPNP` and `SOLVEPNP_DLS`.
**File:** modules/calib3d/src/usac/utils.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,526 @@
+// 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 "../precomp.hpp"
+#include "../usac.hpp"
+#include "opencv2/flann/miniflann.hpp"
+#include <map>
+
```

Review comment:
Wondering if [`decomposeProjectionMatrix()`](https://docs.opencv.org/4.4.0/d9/d0c/group__calib3d.html#gaaae5a7899faa1ffdf268cd9088940248) could be used instead? Because if `decomposeProjection` is better, `decomposeProjectionMatrix()` could be updated maybe?
**File:** modules/calib3d/src/usac/dls_solver.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 50

**Code Changes:**
```diff
+#include "opencv_lapack.h"
+#endif
+
+namespace cv { namespace usac {
+// This is the estimator class for estimating a homography matrix between two images. A model estimation method and error calculation method are implemented
+class DLSPnPImpl : public DLSPnP {
+private:
+    const Mat * points_mat, * calib_norm_points_mat, * K_mat;
+#if defined(HAVE_LAPACK) || defined(HAVE_EIGEN)
+    const Mat &K;
+    const float * const calib_norm_points, * const points;
```

Review comment:
Also, wondering if it is the ["improved" DLS version](http://heschian.io/index.php?page=software) that is implemented? > 05/17/12 - Added "robust" dls_pnp version which avoids the singular configuration of the Cayley paremeters by solving the system 3 times (with the original system centered, and rotated about the x/y/z axes, respectively).
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 207

**Code Changes:**
```diff
@@ -201,6 +203,11 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 {
     CV_INSTRUMENT_REGION();
 
+    if (flags >= 32 && flags <= 38)
+        return usac::solvePnPRansac(_opoints, _ipoints, _cameraMatrix, _distCoeffs,
+            _rvec, _tvec, useExtrinsicGuess, iterationsCount, reprojectionError,
+            confidence, _inliers, flags);
+
     Mat opoints0 = _opoints.getMat(), ipoints0 = _ipoints.getMat();
     Mat opoints, ipoints;
```

Review comment:
This is what it should look like in practice: [AP3P vs P3P](https://www.youtube.com/watch?v=X5h_4okDzyI)
**File:** samples/data/essential_mat_data.txt
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,5 @@
+leuvenA.jpg
+leuvenB.jpg
+651.4462353114224 0 376.27522319223914
+0 653.7348054191838 280.1106539526218
+0 0 1
\ No newline at end of file
```

Review comment:
relative path from where? This file and images are in the same folder.
**File:** samples/cpp/epipolar_lines.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,106 @@
+// 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 "opencv2/calib3d.hpp"
+#include "opencv2/highgui.hpp"
+#include "opencv2/imgproc.hpp"
+
+#include <vector>
```

Review comment:
Absolute "home" paths are not allowed. `samples::findFile()` must be used instead (refer to other OpenCV samples)
**File:** samples/cpp/epipolar_lines.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 4

**Code Changes:**
```diff
@@ -0,0 +1,106 @@
+// 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 "opencv2/calib3d.hpp"
+#include "opencv2/highgui.hpp"
+#include "opencv2/imgproc.hpp"
+
+#include <vector>
```

Review comment:
OpenCV samples are without license headers.
**File:** samples/python/essential_mat_reconstr.py
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,137 @@
+import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
+from mpl_toolkits.mplot3d import axes3d, Axes3D
+
+def getEpipolarError(F, pts1_, pts2_, inliers):
+    pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
+    pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
+    lines2 = np.dot(F  , pts1)
+    lines1 = np.dot(F.T, pts2)
+
```

Review comment:
> pdb Why we need Python debugger in sample?
**File:** samples/python/essential_mat_reconstr.py
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,137 @@
+import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
+from mpl_toolkits.mplot3d import axes3d, Axes3D
+
+def getEpipolarError(F, pts1_, pts2_, inliers):
+    pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
+    pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
+    lines2 = np.dot(F  , pts1)
+    lines1 = np.dot(F.T, pts2)
+
```

Review comment:
> cv2. We are moving from using `cv2.` in OpenCV samples (refer to other code).
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Why disable test body only? (exclude whole test) What is the problem with Eigen/ Lapack? (add a note thorough comment)
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
> 1 What is 1? Prefer to use GoogleTest for errors reporting in test code: ``` FAIL() << msg; ```
**File:** modules/calib3d/test/test_usac.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part

**Code Changes:**
```diff
@@ -0,0 +1,408 @@
+// 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 "test_precomp.hpp"
+
+namespace opencv_test {
+enum TestSolver { Homogr, Fundam, Essen, PnP, Affine};
+/*
```

Review comment:
Please remove `@` symbols (they are not necessary here)
**File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 207

**Code Changes:**
```diff
@@ -201,6 +203,11 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
 {
     CV_INSTRUMENT_REGION();
 
+    if (flags >= 32 && flags <= 38)
+        return usac::solvePnPRansac(_opoints, _ipoints, _cameraMatrix, _distCoeffs,
+            _rvec, _tvec, useExtrinsicGuess, iterationsCount, reprojectionError,
+            confidence, _inliers, flags);
+
     Mat opoints0 = _opoints.getMat(), ipoints0 = _ipoints.getMat();
     Mat opoints, ipoints;
```

Review comment:
I haven't planned to change a whole logic of solvePnP. My goal is about improving RANSAC which will solve PnP too. I added classical P3P solver which seems a bit different from the one in OpenCV. I am not very familiar with whole family of PnP solvers but I think in case of P3P even if solution is not precise enough (e.g., comparing to AP3P) then it will be polished in local optimization step of RANSAC by some DLS or DLT solver. My new idea that I proposed to Vadim is adding P6P solver which does not assume knowledge of intrinsic matrix which is often the case.
**File:** modules/calib3d/src/usac/dls_solver.cpp
**Change Type:** added
**Context:** PR #17683: [GSoC] New RANSAC. Homography part
**Review Line:** 50

**Code Changes:**
```diff
+#include "opencv_lapack.h"
+#endif
+
+namespace cv { namespace usac {
+// This is the estimator class for estimating a homography matrix between two images. A model estimation method and error calculation method are implemented
+class DLSPnPImpl : public DLSPnP {
+private:
+    const Mat * points_mat, * calib_norm_points_mat, * K_mat;
+#if defined(HAVE_LAPACK) || defined(HAVE_EIGEN)
+    const Mat &K;
+    const float * const calib_norm_points, * const points;
```

Review comment:
I would say that I planned to use this DLS solver (Joel A. Hesch and Stergios I. Roumeliotis) inside my RANSAC. This solver will update so-far-the-best model by non-minimal sample.