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
a5b3a205
Commit
a5b3a205
authored
Oct 02, 2014
by
edgarriba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add UPNP case + Modify model_points
parent
84475ef1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+11
-0
No files found.
modules/calib3d/src/solvepnp.cpp
View file @
a5b3a205
...
...
@@ -41,6 +41,7 @@
//M*/
#include "precomp.hpp"
#include "upnp.h"
#include "dls.h"
#include "epnp.h"
#include "p3p.h"
...
...
@@ -107,6 +108,15 @@ bool cv::solvePnP( InputArray _opoints, InputArray _ipoints,
cv
::
Rodrigues
(
R
,
rvec
);
return
result
;
}
else
if
(
flags
==
SOLVEPNP_UPNP
)
{
upnp
PnP
(
cameraMatrix
,
opoints
,
ipoints
);
cv
::
Mat
R
,
rvec
=
_rvec
.
getMat
(),
tvec
=
_tvec
.
getMat
();
PnP
.
compute_pose
(
R
,
tvec
);
cv
::
Rodrigues
(
R
,
rvec
);
return
true
;
}
else
CV_Error
(
CV_StsBadArg
,
"The flags argument must be one of SOLVEPNP_ITERATIVE, SOLVEPNP_P3P, SOLVEPNP_EPNP or SOLVEPNP_DLS"
);
return
false
;
...
...
@@ -205,6 +215,7 @@ bool cv::solvePnPRansac(InputArray _opoints, InputArray _ipoints,
int
model_points
=
4
;
// minimum of number of model points
if
(
flags
==
cv
::
SOLVEPNP_ITERATIVE
)
model_points
=
6
;
else
if
(
flags
==
cv
::
SOLVEPNP_UPNP
)
model_points
=
6
;
else
if
(
flags
==
cv
::
SOLVEPNP_EPNP
)
model_points
=
5
;
double
param1
=
reprojectionError
;
// reprojection error
...
...
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