Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d54b1ad8
Commit
d54b1ad8
authored
May 29, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8805 from catree:solvePnP_doc
parents
36918b3b
542cdb2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+15
-9
solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+1
-1
types.hpp
modules/core/include/opencv2/core/types.hpp
+1
-1
No files found.
modules/calib3d/include/opencv2/calib3d.hpp
View file @
d54b1ad8
...
...
@@ -534,10 +534,10 @@ where N is the number of points. vector\<Point2f\> can be also passed here.
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
assumed.
@param rvec Output rotation vector (see Rodrigues ) that, together with tvec , brings points from
@param rvec Output rotation vector (see
@ref
Rodrigues ) that, together with tvec , brings points from
the model coordinate system to the camera coordinate system.
@param tvec Output translation vector.
@param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses
@param useExtrinsicGuess Parameter used for
#
SOLVEPNP_ITERATIVE. If true (1), the function uses
the provided rvec and tvec values as initial approximations of the rotation and translation
vectors, respectively, and further optimizes them.
@param flags Method for solving a PnP problem:
...
...
@@ -546,15 +546,18 @@ this case the function finds such a pose that minimizes reprojection error, that
of squared distances between the observed projections imagePoints and the projected (using
projectPoints ) objectPoints .
- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang
"Complete Solution Classification for the Perspective-Three-Point Problem". In this case the
function requires exactly four object and image points.
"Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete).
In this case the function requires exactly four object and image points.
- **SOLVEPNP_AP3P** Method is based on the paper of T. Ke, S. Roumeliotis
"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17).
In this case the function requires exactly four object and image points.
- **SOLVEPNP_EPNP** Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the
paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation".
paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation"
(@cite lepetit2009epnp)
.
- **SOLVEPNP_DLS** Method is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis.
"A Direct Least-Squares (DLS) Method for PnP".
"A Direct Least-Squares (DLS) Method for PnP"
(@cite hesch2011direct)
.
- **SOLVEPNP_UPNP** Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto,
F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length
Estimation". In this case the function also estimates the parameters \f$f_x\f$ and \f$f_y\f$
Estimation"
(@cite penate2013exhaustive)
. In this case the function also estimates the parameters \f$f_x\f$ and \f$f_y\f$
assuming that both have the same value. Then the cameraMatrix is updated with the estimated
focal length.
...
...
@@ -575,8 +578,11 @@ projections, as well as the camera matrix and the distortion coefficients.
it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints =
np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are
unstable and sometimes give completly wrong results. If you pass one of these two flags,
**SOLVEPNP_EPNP** method will be used instead.
unstable and sometimes give completly wrong results. If you pass one of these two
flags, **SOLVEPNP_EPNP** method will be used instead.
- The minimum number of points is 4. In the case of **SOLVEPNP_P3P** and **SOLVEPNP_AP3P**
methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions
of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error).
*/
CV_EXPORTS_W
bool
solvePnP
(
InputArray
objectPoints
,
InputArray
imagePoints
,
InputArray
cameraMatrix
,
InputArray
distCoeffs
,
...
...
modules/calib3d/src/solvepnp.cpp
View file @
d54b1ad8
...
...
@@ -61,7 +61,7 @@ bool solvePnP( InputArray _opoints, InputArray _ipoints,
Mat
opoints
=
_opoints
.
getMat
(),
ipoints
=
_ipoints
.
getMat
();
int
npoints
=
std
::
max
(
opoints
.
checkVector
(
3
,
CV_32F
),
opoints
.
checkVector
(
3
,
CV_64F
));
CV_Assert
(
npoints
>=
0
&&
npoints
==
std
::
max
(
ipoints
.
checkVector
(
2
,
CV_32F
),
ipoints
.
checkVector
(
2
,
CV_64F
))
);
CV_Assert
(
npoints
>=
4
&&
npoints
==
std
::
max
(
ipoints
.
checkVector
(
2
,
CV_32F
),
ipoints
.
checkVector
(
2
,
CV_64F
))
);
Mat
rvec
,
tvec
;
if
(
flags
!=
SOLVEPNP_ITERATIVE
)
...
...
modules/core/include/opencv2/core/types.hpp
View file @
d54b1ad8
...
...
@@ -572,7 +572,7 @@ public:
/** @brief Template class for a 4-element vector derived from Vec.
Being derived from Vec\<_Tp, 4\> , Scalar_ and Scalar can be used just as typical 4-element
Being derived from Vec\<_Tp, 4\> , Scalar
\
_ and Scalar can be used just as typical 4-element
vectors. In addition, they can be converted to/from CvScalar . The type Scalar is widely used in
OpenCV to pass pixel values.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment