Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vision
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
plugins
vision
Commits
7e5f7f13
Commit
7e5f7f13
authored
3 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
Trying cheirality check
parent
5a7efea9
No related branches found
No related tags found
1 merge request
!38
Draft: Resolve "Improve visual odometry"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_processor_visual_odometry.cpp
+47
-4
47 additions, 4 deletions
test/gtest_processor_visual_odometry.cpp
with
47 additions
and
4 deletions
test/gtest_processor_visual_odometry.cpp
+
47
−
4
View file @
7e5f7f13
...
@@ -434,8 +434,8 @@ TEST_F(ProcessorVOMultiView_class, filterWithEssential)
...
@@ -434,8 +434,8 @@ TEST_F(ProcessorVOMultiView_class, filterWithEssential)
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// We had here an outlier: a keyPoint that doesn't move
// We had here an outlier: a keyPoint that doesn't move
mwkps_c1
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
8
,
WKeyPoint
(
cv
::
KeyPoint
(
cv
::
Point2
d
(
120
,
140
),
1
))));
mwkps_c1
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
8
,
WKeyPoint
(
cv
::
KeyPoint
(
cv
::
Point2
f
(
120
,
140
),
1
))));
mwkps_c2
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
8
,
WKeyPoint
(
cv
::
KeyPoint
(
cv
::
Point2
d
(
120
,
140
),
1
))));
mwkps_c2
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
8
,
WKeyPoint
(
cv
::
KeyPoint
(
cv
::
Point2
f
(
120
,
140
),
1
))));
tracks_c1_c2
.
insert
(
std
::
pair
<
size_t
,
size_t
>
(
8
,
8
));
tracks_c1_c2
.
insert
(
std
::
pair
<
size_t
,
size_t
>
(
8
,
8
));
// point at 8 must be discarded
// point at 8 must be discarded
...
@@ -463,6 +463,7 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
...
@@ -463,6 +463,7 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
pts_c2
.
push_back
(
mwkps_c2
.
at
(
i
).
getCvKeyPoint
().
pt
);
pts_c2
.
push_back
(
mwkps_c2
.
at
(
i
).
getCvKeyPoint
().
pt
);
}
}
cv
::
Mat
R_out
,
t_out
;
cv
::
Mat
R_out
,
t_out
;
cv
::
Mat
mask
;
cv
::
Mat
mask
;
cv
::
recoverPose
(
E
,
pts_c1
,
pts_c2
,
Kcv
,
R_out
,
t_out
,
mask
);
cv
::
recoverPose
(
E
,
pts_c1
,
pts_c2
,
Kcv
,
R_out
,
t_out
,
mask
);
...
@@ -470,10 +471,53 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
...
@@ -470,10 +471,53 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
Eigen
::
Matrix3d
R_out_eig
,
R_21_eig
;
Eigen
::
Matrix3d
R_out_eig
,
R_21_eig
;
cv
::
cv2eigen
(
R_out
,
R_out_eig
);
cv
::
cv2eigen
(
R_out
,
R_out_eig
);
ASSERT_MATRIX_APPROX
(
R_21
,
R_out_eig
,
1e-4
);
ASSERT_MATRIX_APPROX
(
R_21
,
R_out_eig
,
1e-4
);
//////////////////////////////////////////////////////
// Can we also use it to detect outliers using cheirality check?
// Does not seem so...
// Maybe the outliers are not rightly chosen for this test:
// inside recoverPose, triangulatePoints is called and then there are
// checks on depth coordinate of the triangulated point in both camera frames:
// if depth is negative or depth lower than a threshold, point considered as an "outlier"
// Can simply mean an absence of movement, hard to tune threshold...
// add outliers
pts_c1
.
push_back
(
cv
::
Point2f
(
165.0
,
190.0
));
pts_c2
.
push_back
(
cv
::
Point2f
(
200.0
,
190.0
));
pts_c1
.
push_back
(
cv
::
Point2f
(
100.0
,
250.0
));
pts_c2
.
push_back
(
cv
::
Point2f
(
100.0
,
250.0
));
pts_c1
.
push_back
(
cv
::
Point2f
(
400.0
,
70.0
));
pts_c2
.
push_back
(
cv
::
Point2f
(
400.0
,
70.0
));
pts_c1
.
push_back
(
cv
::
Point2f
(
300.0
,
300.0
));
pts_c2
.
push_back
(
cv
::
Point2f
(
100.0
,
300.0
));
cv
::
Mat
triangulated_pts
;
double
distance_threshold
=
80.0
;
// cv::recoverPose(E, pts_c1, pts_c2, Kcv, R_out, t_out, mask);
cv
::
recoverPose
(
E
,
pts_c1
,
pts_c2
,
Kcv
,
R_out
,
t_out
,
distance_threshold
,
mask
,
triangulated_pts
);
// triangulated_pts.size()
std
::
cout
<<
triangulated_pts
.
size
()
<<
std
::
endl
;
// std::cout << "mask" << std::endl;
// std::cout << mask << std::endl;
// std::cout << "R_out" << std::endl;
// std::cout << R_out << std::endl;
// std::cout << "t_out" << std::endl;
// std::cout << t_out << std::endl;
}
}
// SEFAULT!!!!!!!!
//
// SEFAULT!!!!!!!!
// TEST_F(ProcessorVOMultiView_class, tryTriangulationFromFeatures)
// TEST_F(ProcessorVOMultiView_class, tryTriangulationFromFeatures)
// {
// {
// ProblemPtr problem = Problem::create("PO", 3);
// ProblemPtr problem = Problem::create("PO", 3);
...
@@ -500,7 +544,6 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
...
@@ -500,7 +544,6 @@ TEST_F(ProcessorVOMultiView_class, recoverPoseOpenCV)
// auto f2_pi = std::static_pointer_cast<FeaturePointImage>(f2);
// auto f2_pi = std::static_pointer_cast<FeaturePointImage>(f2);
// processor->tryTriangulationFromFeatures(f2_pi, track, pt_c);
// processor->tryTriangulationFromFeatures(f2_pi, track, pt_c);
// WOLF_INFO(pt_c);
// WOLF_INFO(pt_c);
// }
// }
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment