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
d385cdda
Commit
d385cdda
authored
2 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in gtest -- weirdly passing most of the times!!
parent
0cf027f2
No related branches found
No related tags found
1 merge request
!41
Draft: Resolve "Fix and improve RANSAC step"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_processor_visual_odometry.cpp
+7
-7
7 additions, 7 deletions
test/gtest_processor_visual_odometry.cpp
with
7 additions
and
7 deletions
test/gtest_processor_visual_odometry.cpp
+
7
−
7
View file @
d385cdda
...
@@ -331,12 +331,6 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
...
@@ -331,12 +331,6 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
KeyPointsMap
mwkps_prev
,
mwkps_curr
;
KeyPointsMap
mwkps_prev
,
mwkps_curr
;
TracksMap
tracks_prev_curr
;
TracksMap
tracks_prev_curr
;
cv
::
Mat
E
;
cv
::
Mat
E
;
// Create a simple camera model
Eigen
::
Matrix3f
K
;
K
<<
100
,
0
,
240
,
0
,
100
,
240
,
0
,
0
,
1
;
// Create a processor
// Create a processor
ParamsProcessorVisualOdometryPtr
params
=
std
::
make_shared
<
ParamsProcessorVisualOdometry
>
();
ParamsProcessorVisualOdometryPtr
params
=
std
::
make_shared
<
ParamsProcessorVisualOdometry
>
();
...
@@ -350,10 +344,14 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
...
@@ -350,10 +344,14 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
// Install camera
// Install camera
ParamsSensorCameraPtr
intr
=
std
::
make_shared
<
ParamsSensorCamera
>
();
ParamsSensorCameraPtr
intr
=
std
::
make_shared
<
ParamsSensorCamera
>
();
// intr->pinhole_model_raw = Eigen::Vector4d(240, 240, 100, 100);
intr
->
pinhole_model_raw
=
Eigen
::
Vector4d
(
100
,
100
,
240
,
240
);
intr
->
pinhole_model_raw
=
Eigen
::
Vector4d
(
100
,
100
,
240
,
240
);
intr
->
pinhole_model_rectified
=
intr
->
pinhole_model_raw
;
intr
->
width
=
480
;
intr
->
width
=
480
;
intr
->
height
=
480
;
intr
->
height
=
480
;
SensorCameraPtr
cam_ptr
=
std
::
make_shared
<
SensorCamera
>
((
Eigen
::
Vector7d
()
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
).
finished
(),
intr
);
SensorCameraPtr
cam_ptr
=
std
::
make_shared
<
SensorCamera
>
((
Eigen
::
Vector7d
()
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
).
finished
(),
intr
);
processor
.
configure
(
cam_ptr
);
processor
.
configure
(
cam_ptr
);
// Set 3D points on the previous view
// Set 3D points on the previous view
...
@@ -366,6 +364,9 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
...
@@ -366,6 +364,9 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
Eigen
::
Vector3f
X7_prev
(
0.1
,
-
1.0
,
3.0
);
Eigen
::
Vector3f
X7_prev
(
0.1
,
-
1.0
,
3.0
);
Eigen
::
Vector3f
X8_prev
(
0.75
,
0.75
,
2.0
);
Eigen
::
Vector3f
X8_prev
(
0.75
,
0.75
,
2.0
);
// Get camera model
Matrix3f
K
=
cam_ptr
->
getIntrinsicMatrix
().
cast
<
float
>
();
// Project pixels in the previous view
// Project pixels in the previous view
mwkps_prev
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
0
,
WKeyPoint
(
cv
::
KeyPoint
(
project
(
K
,
X1_prev
),
1
))));
mwkps_prev
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
0
,
WKeyPoint
(
cv
::
KeyPoint
(
project
(
K
,
X1_prev
),
1
))));
mwkps_prev
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
1
,
WKeyPoint
(
cv
::
KeyPoint
(
project
(
K
,
X2_prev
),
1
))));
mwkps_prev
.
insert
(
std
::
pair
<
size_t
,
WKeyPoint
>
(
1
,
WKeyPoint
(
cv
::
KeyPoint
(
project
(
K
,
X2_prev
),
1
))));
...
@@ -378,7 +379,6 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
...
@@ -378,7 +379,6 @@ TEST(ProcessorVisualOdometry, filterWithEssential)
// Set the transformation between the two views
// Set the transformation between the two views
Eigen
::
Vector3f
t
(
0.1
,
0.1
,
0.0
);
Eigen
::
Vector3f
t
(
0.1
,
0.1
,
0.0
);
// Eigen::Vector3f euler(0.0, 0.0, 0.0); // degenerate case!
Eigen
::
Vector3f
euler
(
0.2
,
0.1
,
0.3
);
Eigen
::
Vector3f
euler
(
0.2
,
0.1
,
0.3
);
Eigen
::
Matrix3f
R
=
e2R
(
euler
);
Eigen
::
Matrix3f
R
=
e2R
(
euler
);
...
...
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