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
de55126b
Commit
de55126b
authored
Apr 27, 2014
by
Samson Yilma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed warnings and parameter name mismatches, added #include needed in some platforms.
parent
e6420bde
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+5
-5
homography_decomp.cpp
modules/calib3d/src/homography_decomp.cpp
+5
-4
test_homography_decomp.cpp
modules/calib3d/test/test_homography_decomp.cpp
+4
-4
No files found.
modules/calib3d/include/opencv2/calib3d.hpp
View file @
de55126b
...
...
@@ -314,11 +314,11 @@ CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst,
double
ransacThreshold
=
3
,
double
confidence
=
0.99
);
CV_EXPORTS_W
int
decomposeHomographyMat
(
InputArray
_
H
,
InputArray
_
K
,
OutputArrayOfArrays
_
rotations
,
OutputArrayOfArrays
_
translations
,
OutputArrayOfArrays
_
normals
);
CV_EXPORTS_W
int
decomposeHomographyMat
(
InputArray
H
,
InputArray
K
,
OutputArrayOfArrays
rotations
,
OutputArrayOfArrays
translations
,
OutputArrayOfArrays
normals
);
class
CV_EXPORTS_W
StereoMatcher
:
public
Algorithm
{
...
...
modules/calib3d/src/homography_decomp.cpp
View file @
de55126b
...
...
@@ -47,6 +47,7 @@
//M*/
#include "precomp.hpp"
#include <memory>
namespace
cv
{
...
...
@@ -189,7 +190,7 @@ void HomographyDecompZhang::decompose(std::vector<CameraMotion>& camMotions)
double
lambda1t3
=
lambda1
*
lambda3
;
double
t1
=
1.0
/
(
2.0
*
lambda1t3
);
double
t2
=
sqrt
f
(
1.0
+
4.0
*
lambda1t3
/
lambda1m3_2
);
double
t2
=
sqrt
(
1.0
+
4.0
*
lambda1t3
/
lambda1m3_2
);
double
t12
=
t1
*
t2
;
double
e1
=
-
t1
+
t12
;
//t1*(-1.0f + t2 );
...
...
@@ -197,8 +198,8 @@ void HomographyDecompZhang::decompose(std::vector<CameraMotion>& camMotions)
double
e1_2
=
e1
*
e1
;
double
e3_2
=
e3
*
e3
;
double
nv1p
=
sqrt
f
(
e1_2
*
lambda1m3_2
+
2
*
e1
*
(
lambda1t3
-
1
)
+
1.0
);
double
nv3p
=
sqrt
f
(
e3_2
*
lambda1m3_2
+
2
*
e3
*
(
lambda1t3
-
1
)
+
1.0
);
double
nv1p
=
sqrt
(
e1_2
*
lambda1m3_2
+
2
*
e1
*
(
lambda1t3
-
1
)
+
1.0
);
double
nv3p
=
sqrt
(
e3_2
*
lambda1m3_2
+
2
*
e3
*
(
lambda1t3
-
1
)
+
1.0
);
double
v1p
[
3
],
v3p
[
3
];
v1p
[
0
]
=
Vt
.
at
<
double
>
(
0
)
*
nv1p
,
v1p
[
1
]
=
Vt
.
at
<
double
>
(
1
)
*
nv1p
,
v1p
[
2
]
=
Vt
.
at
<
double
>
(
2
)
*
nv1p
;
...
...
@@ -378,7 +379,7 @@ void HomographyDecompInria::decompose(std::vector<CameraMotion>& camMotions)
}
double
traceS
=
S
(
0
,
0
)
+
S
(
1
,
1
)
+
S
(
2
,
2
);
double
v
=
2.0
*
sqrt
f
(
1
+
traceS
-
M00
-
M11
-
M22
);
double
v
=
2.0
*
sqrt
(
1
+
traceS
-
M00
-
M11
-
M22
);
double
ESii
=
signd
(
S
(
indx
,
indx
))
;
double
r_2
=
2
+
traceS
+
v
;
...
...
modules/calib3d/test/test_homography_decomp.cpp
View file @
de55126b
...
...
@@ -68,9 +68,9 @@ protected:
decomposeHomographyMat
(
_H
,
_K
,
rotations
,
translations
,
normals
);
//there should be at least 1 solution
ASSERT_GT
(
rotations
.
size
(
),
0
);
ASSERT_GT
(
translations
.
size
(
),
0
);
ASSERT_GT
(
normals
.
size
(
),
0
);
ASSERT_GT
(
static_cast
<
int
>
(
rotations
.
size
()
),
0
);
ASSERT_GT
(
static_cast
<
int
>
(
translations
.
size
()
),
0
);
ASSERT_GT
(
static_cast
<
int
>
(
normals
.
size
()
),
0
);
ASSERT_EQ
(
rotations
.
size
(),
normals
.
size
());
ASSERT_EQ
(
translations
.
size
(),
normals
.
size
());
...
...
@@ -78,7 +78,7 @@ protected:
ASSERT_TRUE
(
containsValidMotion
(
rotations
,
translations
,
normals
));
decomposeHomographyMat
(
_H
,
_K
,
rotations
,
noArray
(),
noArray
());
ASSERT_GT
(
rotations
.
size
(
),
0
);
ASSERT_GT
(
static_cast
<
int
>
(
rotations
.
size
()
),
0
);
}
private
:
...
...
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