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
40f6d320
Commit
40f6d320
authored
Jul 21, 2014
by
edgarriba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last update
parent
42ab7fd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
19 deletions
+33
-19
dls.cpp
modules/calib3d/src/dls.cpp
+0
-0
dls.h
modules/calib3d/src/dls.h
+30
-15
solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+3
-4
No files found.
modules/calib3d/src/dls.cpp
View file @
40f6d320
This source diff could not be displayed because it is too large. You can
view the blob
instead.
modules/calib3d/src/dls.h
View file @
40f6d320
#ifndef DLS_H
#ifndef DLS_H
_
#define DLS_H
#define DLS_H
_
#include "precomp.hpp"
#include "precomp.hpp"
using
namespace
std
;
class
dls
class
dls
{
{
public
:
public
:
dls
(
const
cv
::
Mat
&
opoints
,
const
cv
::
Mat
&
ipoints
);
dls
(
const
cv
::
Mat
&
opoints
,
const
cv
::
Mat
&
ipoints
);
~
dls
();
virtual
~
dls
();
template
<
typename
OpointType
,
typename
O
,
typename
IpointType
,
typename
I
>
void
init_points
(
const
cv
::
Mat
&
opoints
,
const
cv
::
Mat
&
ipoints
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
p
.
at
<
O
>
(
0
,
i
)
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
x
;
p
.
at
<
O
>
(
1
,
i
)
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
y
;
p
.
at
<
O
>
(
2
,
i
)
=
opoints
.
at
<
OpointType
>
(
0
,
i
).
z
;
z
.
at
<
I
>
(
0
,
i
)
=
ipoints
.
at
<
IpointType
>
(
0
,
i
).
x
;
z
.
at
<
I
>
(
1
,
i
)
=
ipoints
.
at
<
IpointType
>
(
0
,
i
).
y
;
z
.
at
<
I
>
(
2
,
i
)
=
(
I
)
1
;
}
}
void
init_vectors
(
const
cv
::
Mat
&
opoints
,
const
cv
::
Mat
&
ipoints
);
void
norm_z_vector
(
);
void
build_coeff_mat
t
rix
();
void
build_coeff_matrix
();
cv
::
Mat
LeftMultVec
(
const
cv
::
Mat
&
v
);
cv
::
Mat
LeftMultVec
(
const
cv
::
Mat
&
v
);
cv
::
Mat
cayley_LS_M
(
const
std
::
vector
<
double
>&
a
,
const
std
::
vector
<
double
>&
b
,
const
std
::
vector
<
double
>&
c
,
const
std
::
vector
<
double
>&
u
);
cv
::
Mat
cayley_LS_M
(
const
std
::
vector
<
double
>&
a
,
const
std
::
vector
<
double
>&
b
,
const
std
::
vector
<
double
>&
c
,
const
std
::
vector
<
double
>&
u
);
private
:
private
:
cv
::
Mat
H
;
// coeff matrix
cv
::
Mat
H
,
A
,
D_mat
;
// coeff matrix
cv
::
Mat
A
;
cv
::
Mat
p
;
// object points
cv
::
Mat
D_mat
;
cv
::
Mat
z
;
// image points
std
::
vector
<
double
>
f1coeff
;
int
N
;
// number of input points
std
::
vector
<
double
>
f2coeff
;
std
::
vector
<
double
>
f1coeff
,
f2coeff
,
f3coeff
;
std
::
vector
<
double
>
f3coeff
;
cv
::
Mat
p
;
// object points
cv
::
Mat
z
;
// image points
int
N
;
// number of input points
};
};
...
...
modules/calib3d/src/solvepnp.cpp
View file @
40f6d320
...
@@ -100,11 +100,10 @@ bool cv::solvePnP( InputArray _opoints, InputArray _ipoints,
...
@@ -100,11 +100,10 @@ bool cv::solvePnP( InputArray _opoints, InputArray _ipoints,
cv
::
Mat
undistortedPoints
;
cv
::
Mat
undistortedPoints
;
cv
::
undistortPoints
(
ipoints
,
undistortedPoints
,
cameraMatrix
,
distCoeffs
);
cv
::
undistortPoints
(
ipoints
,
undistortedPoints
,
cameraMatrix
,
distCoeffs
);
//dls PnP(opoints, undistortedPoints);
dls
PnP
(
opoints
,
ipoints
);
// FOR TESTING
dls
PnP
(
opoints
,
undistortedPoints
);
//TODO: DO SOMETHING WITH R and t
// DO SOMETHING
cv
::
Mat
R
,
rvec
=
_rvec
.
getMat
(),
tvec
=
_tvec
.
getMat
();
return
true
;
return
true
;
}
}
...
...
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