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
6b70e3c7
Commit
6b70e3c7
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Doc and format
parent
b7b86932
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!36
After cmake and const refactor
,
!28
Resolve "Building a new visual odometry system"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vision/processor/active_search.h
+11
-60
11 additions, 60 deletions
include/vision/processor/active_search.h
with
11 additions
and
60 deletions
include/vision/processor/active_search.h
+
11
−
60
View file @
6b70e3c7
...
@@ -143,7 +143,7 @@ class ActiveSearchGrid {
...
@@ -143,7 +143,7 @@ class ActiveSearchGrid {
/**
/**
* \brief Void constructor
* \brief Void constructor
*
*
* Calling this constructor requires the use of set
Parameters
() to configure.
* Calling this constructor requires the use of set
up
() to configure.
*/
*/
ActiveSearchGrid
();
ActiveSearchGrid
();
...
@@ -153,12 +153,13 @@ class ActiveSearchGrid {
...
@@ -153,12 +153,13 @@ class ActiveSearchGrid {
* \param _img_size_v vertical image size.
* \param _img_size_v vertical image size.
* \param _n_cells_h horizontal number of cells per image width.
* \param _n_cells_h horizontal number of cells per image width.
* \param _n_cells_v vertical number of cells per image height.
* \param _n_cells_v vertical number of cells per image height.
* \param _separation minimum separation between existing and new points.
* \param _margin minimum separation to the edge of the image
* \param _margin minimum separation to the edge of the image
* \param _separation minimum separation between existing and new points.
*/
*/
ActiveSearchGrid
(
const
int
&
_img_size_h
,
const
int
&
_img_size_v
,
ActiveSearchGrid
(
const
int
&
_img_size_h
,
const
int
&
_img_size_v
,
const
int
&
_n_cells_h
,
const
int
&
_n_cells_v
,
const
int
&
_n_cells_h
,
const
int
&
_n_cells_v
,
const
int
&
_margin
=
0
,
const
int
&
_separation
=
0
);
const
int
&
_margin
=
0
,
const
int
&
_separation
=
0
);
/**
/**
* \brief Function to set the parameters of the active search grid
* \brief Function to set the parameters of the active search grid
...
@@ -166,12 +167,13 @@ class ActiveSearchGrid {
...
@@ -166,12 +167,13 @@ class ActiveSearchGrid {
* \param _img_size_v vertical image size.
* \param _img_size_v vertical image size.
* \param _n_cells_h horizontal number of cells per image width.
* \param _n_cells_h horizontal number of cells per image width.
* \param _n_cells_v vertical number of cells per image height.
* \param _n_cells_v vertical number of cells per image height.
* \param _separation minimum separation between existing and new points.
* \param _margin minimum separation to the edge of the image
* \param _margin minimum separation to the edge of the image
* \param _separation minimum separation between existing and new points.
*/
*/
void
setup
(
const
int
&
_img_size_h
,
const
int
&
_img_size_v
,
void
setup
(
const
int
&
_img_size_h
,
const
int
&
_img_size_v
,
const
int
&
_n_cells_h
,
const
int
&
_n_cells_v
,
const
int
&
_n_cells_h
,
const
int
&
_n_cells_v
,
const
int
&
_margin
=
0
,
const
int
&
_separation
=
0
);
const
int
&
_margin
=
0
,
const
int
&
_separation
=
0
);
/**
/**
* \brief Re-set the image size
* \brief Re-set the image size
...
@@ -203,7 +205,7 @@ class ActiveSearchGrid {
...
@@ -203,7 +205,7 @@ class ActiveSearchGrid {
/**
/**
* \brief Add a projected pixel to the grid.
* \brief Add a projected pixel to the grid.
* \param _pix the pixel to add as an Eigen 2-vector with any Scalar type.
* \param _pix the pixel to add as an Eigen 2-vector with any Scalar type
(can be a non-integer)
.
*/
*/
template
<
typename
Scalar
>
template
<
typename
Scalar
>
void
hitCell
(
const
Eigen
::
Matrix
<
Scalar
,
2
,
1
>&
_pix
);
void
hitCell
(
const
Eigen
::
Matrix
<
Scalar
,
2
,
1
>&
_pix
);
...
@@ -275,21 +277,12 @@ inline void ActiveSearchGrid::hitCell(const cv::KeyPoint& _pix)
...
@@ -275,21 +277,12 @@ inline void ActiveSearchGrid::hitCell(const cv::KeyPoint& _pix)
hitCell
(
_pix
.
pt
.
x
,
_pix
.
pt
.
y
);
hitCell
(
_pix
.
pt
.
x
,
_pix
.
pt
.
y
);
}
}
/**
* \brief Add a projected pixel to the grid.
* \param _pix the pixel to add as an Eigen 2-vector.
*/
template
<
typename
Scalar
>
template
<
typename
Scalar
>
inline
void
ActiveSearchGrid
::
hitCell
(
const
Eigen
::
Matrix
<
Scalar
,
2
,
1
>&
_pix
)
inline
void
ActiveSearchGrid
::
hitCell
(
const
Eigen
::
Matrix
<
Scalar
,
2
,
1
>&
_pix
)
{
{
hitCell
(
_pix
(
0
),
_pix
(
1
));
hitCell
(
_pix
(
0
),
_pix
(
1
));
}
}
/**
* \brief Add a projected pixel to the grid.
* \param _x the x-coordinate of the pixel to add.
* \param _y the y-coordinate of the pixel to add.
*/
template
<
typename
Scalar
>
template
<
typename
Scalar
>
inline
void
ActiveSearchGrid
::
hitCell
(
const
Scalar
_x
,
const
Scalar
_y
)
inline
void
ActiveSearchGrid
::
hitCell
(
const
Scalar
_x
,
const
Scalar
_y
)
{
{
...
@@ -303,9 +296,6 @@ inline void ActiveSearchGrid::hitCell(const Scalar _x, const Scalar _y)
...
@@ -303,9 +296,6 @@ inline void ActiveSearchGrid::hitCell(const Scalar _x, const Scalar _y)
projections_count_
(
cell
(
0
),
cell
(
1
))
++
;
projections_count_
(
cell
(
0
),
cell
(
1
))
++
;
}
}
/**
* Get cell corresponding to pixel
*/
template
<
typename
Scalar
>
template
<
typename
Scalar
>
inline
Eigen
::
Vector2i
ActiveSearchGrid
::
coords2cell
(
const
Scalar
_x
,
const
Scalar
_y
)
inline
Eigen
::
Vector2i
ActiveSearchGrid
::
coords2cell
(
const
Scalar
_x
,
const
Scalar
_y
)
{
{
...
@@ -317,48 +307,9 @@ inline Eigen::Vector2i ActiveSearchGrid::coords2cell(const Scalar _x, const Scal
...
@@ -317,48 +307,9 @@ inline Eigen::Vector2i ActiveSearchGrid::coords2cell(const Scalar _x, const Scal
inline
Eigen
::
Vector2i
ActiveSearchGrid
::
cellCenter
(
const
Eigen
::
Vector2i
&
_cell
)
inline
Eigen
::
Vector2i
ActiveSearchGrid
::
cellCenter
(
const
Eigen
::
Vector2i
&
_cell
)
{
{
return
cellOrigin
(
_cell
)
+
cell_size_
/
2
;
return
cellOrigin
(
_cell
)
+
cell_size_
/
2
;
// beware these are all integers, so the result is truncated to the smaller integer
}
}
//#if 0
// /**
// * Class for active search algorithms.
// * \ingroup rtslam
// */
// class ActiveSearch {
// public:
// vecb visibleObs;
// vecb selectedObs;
// /**
// * Project all landmarks to the sensor space.
// *
// * This function also computes visibility and information gain
// * for each observation.
// * The result is a map of visible observations,
// * ordered from least to most expected information gain.
// *
// * \param senPtr pointer to the sensor under consideration.
// * \return a map of all observations that are visible from the sensor, ordered according to the information gain.
// */
// std::map<double, observation_ptr_t> projectAll(const sensor_ptr_t & senPtr, Size & numVis);
// /**
// * Predict observed appearance.
// * This function predicts the appearance of the perceived landmark.
// * It does so by computing the appearance of the landmark descriptor from the current sensor position.
// * The result of this operation is an updated observation.
// * \param obsPtr a pointer to the observation.
// */
// void predictApp(const observation_ptr_t & obsPtr);
// /**
// * Scan search region for match.
// */
// void scanObs(const observation_ptr_t & obsPtr, const image::ConvexRoi & roi);
// };
//#endif
}
}
#endif
/* ACTIVESEARCH_H_ */
#endif
/* ACTIVESEARCH_H_ */
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