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
6c308dac
Commit
6c308dac
authored
Apr 06, 2012
by
Alexander Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed problem in solvePnPRansac with TBB
parent
61c7c441
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
epnp.cpp
modules/calib3d/src/epnp.cpp
+8
-3
epnp.h
modules/calib3d/src/epnp.h
+11
-9
No files found.
modules/calib3d/src/epnp.cpp
View file @
6c308dac
...
...
@@ -29,10 +29,18 @@ epnp::epnp(const cv::Mat& cameraMatrix, const cv::Mat& opoints, const cv::Mat& i
alphas
.
resize
(
4
*
number_of_correspondences
);
pcs
.
resize
(
3
*
number_of_correspondences
);
max_nr
=
0
;
A1
=
NULL
;
A2
=
NULL
;
}
epnp
::~
epnp
()
{
if
(
A1
)
delete
[]
A1
;
if
(
A2
)
delete
[]
A2
;
}
void
epnp
::
choose_control_points
(
void
)
...
...
@@ -513,9 +521,6 @@ void epnp::gauss_newton(const CvMat * L_6x10, const CvMat * Rho,
void
epnp
::
qr_solve
(
CvMat
*
A
,
CvMat
*
b
,
CvMat
*
X
)
{
static
int
max_nr
=
0
;
static
double
*
A1
,
*
A2
;
const
int
nr
=
A
->
rows
;
const
int
nc
=
A
->
cols
;
...
...
modules/calib3d/src/epnp.h
View file @
6c308dac
...
...
@@ -14,24 +14,24 @@ class epnp {
void
compute_pose
(
cv
::
Mat
&
R
,
cv
::
Mat
&
t
);
private
:
template
<
typename
T
>
void
init_camera_parameters
(
const
cv
::
Mat
&
cameraMatrix
)
{
uc
=
cameraMatrix
.
at
<
T
>
(
0
,
2
);
vc
=
cameraMatrix
.
at
<
T
>
(
1
,
2
);
fu
=
cameraMatrix
.
at
<
T
>
(
0
,
0
);
fv
=
cameraMatrix
.
at
<
T
>
(
1
,
1
);
void
init_camera_parameters
(
const
cv
::
Mat
&
cameraMatrix
)
{
uc
=
cameraMatrix
.
at
<
T
>
(
0
,
2
);
vc
=
cameraMatrix
.
at
<
T
>
(
1
,
2
);
fu
=
cameraMatrix
.
at
<
T
>
(
0
,
0
);
fv
=
cameraMatrix
.
at
<
T
>
(
1
,
1
);
}
template
<
typename
OpointType
,
typename
IpointType
>
void
init_points
(
const
cv
::
Mat
&
opoints
,
const
cv
::
Mat
&
ipoints
)
{
for
(
int
i
=
0
;
i
<
number_of_correspondences
;
i
++
)
{
for
(
int
i
=
0
;
i
<
number_of_correspondences
;
i
++
)
{
pws
[
3
*
i
]
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
x
;
pws
[
3
*
i
+
1
]
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
y
;
pws
[
3
*
i
+
2
]
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
z
;
us
[
2
*
i
]
=
ipoints
.
at
<
IpointType
>
(
0
,
i
).
x
*
fu
+
uc
;
us
[
2
*
i
+
1
]
=
ipoints
.
at
<
IpointType
>
(
0
,
i
).
y
*
fv
+
vc
;
us
[
2
*
i
+
1
]
=
ipoints
.
at
<
IpointType
>
(
0
,
i
).
y
*
fv
+
vc
;
}
}
double
reprojection_error
(
const
double
R
[
3
][
3
],
const
double
t
[
3
]);
...
...
@@ -74,6 +74,8 @@ class epnp {
double
cws
[
4
][
3
],
ccs
[
4
][
3
];
double
cws_determinant
;
int
max_nr
;
double
*
A1
,
*
A2
;
};
#endif
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