Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vision_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
labrobotica
algorithms
vision_utils
Commits
86f86485
Commit
86f86485
authored
7 years ago
by
Angel Santamaria-Navarro
Browse files
Options
Downloads
Patches
Plain Diff
Rename FeatureIdxGrid -> OccupancyGrid to TrackingGrid
parent
82c22137
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/vision_utils.h
+22
-22
22 additions, 22 deletions
src/vision_utils.h
with
22 additions
and
22 deletions
src/vision_utils.h
+
22
−
22
View file @
86f86485
...
...
@@ -225,7 +225,7 @@ public:
cell_width_
(
_img_width
/
_n_cell_cols
),
cell_height_
(
_img_height
/
_n_cell_rows
),
grid_
(
_n_cell_rows
,
std
::
vector
<
FeatureIdxMap
>
(
_n_cell_cols
,
FeatureIdxMap
())),
occupancy
_grid_
(
Eigen
::
MatrixXi
::
Zero
(
_n_cell_rows
,
_n_cell_cols
)),
tracking
_grid_
(
Eigen
::
MatrixXi
::
Zero
(
_n_cell_rows
,
_n_cell_cols
)),
empty_cells_tile_tmp_
(
Eigen
::
MatrixXi
::
Zero
(
2
,
n_cell_rows_
*
n_cell_cols_
))
{
//
...
...
@@ -256,7 +256,7 @@ public:
for
(
auto
ii
=
0
;
ii
<
grid_
.
size
();
++
ii
)
for
(
auto
jj
=
0
;
jj
<
grid_
.
size
();
++
jj
)
grid_
.
at
(
ii
).
at
(
jj
).
clear
();
occupancy
_grid_
.
setZero
();
tracking
_grid_
.
setZero
();
empty_cells_tile_tmp_
.
setZero
();
}
...
...
@@ -320,31 +320,31 @@ public:
/**
* \brief Hit occupancy grid by cell.
*/
inline
void
hit
OccupancyGrid
(
const
Eigen
::
Vector2i
&
_cell
)
inline
void
hit
TrackingCell
(
const
Eigen
::
Vector2i
&
_cell
)
{
if
(
_cell
(
0
)
<
0
||
_cell
(
1
)
<
0
||
_cell
(
0
)
>
n_cell_rows_
||
_cell
(
1
)
>
n_cell_cols_
)
return
;
occupancy
_grid_
(
_cell
(
0
),
_cell
(
1
))
++
;
tracking
_grid_
(
_cell
(
0
),
_cell
(
1
))
++
;
}
/**
* \brief Hit occupancy grid by cell coordinates (row, col).
*/
template
<
typename
Scalar
>
inline
void
hitTrackingCell
(
const
Scalar
_row
,
const
Scalar
_col
)
{
Eigen
::
Vector2i
cell
;
cell
<<
_row
,
_col
;
hitTrackingCell
(
cell
);
}
/**
* \brief Hit occupancy grid by keypoint.
*/
inline
void
hit
OccupancyGrid
(
const
cv
::
KeyPoint
&
_pix
)
inline
void
hit
TrackingCell
(
const
cv
::
KeyPoint
&
_pix
)
{
Eigen
::
Vector2i
cell
=
getCell
(
_pix
);
hitOccupancyGrid
(
cell
);
}
/**
* \brief Hit occupancy grid by cell coordinates (row, col).
*/
template
<
typename
Scalar
>
inline
void
hitOccupancyGrid
(
const
Scalar
_row
,
const
Scalar
_col
)
{
Eigen
::
Vector2i
cell
;
cell
<<
_row
,
_col
;
hitOccupancyGrid
(
cell
);
hitTrackingCell
(
cell
);
}
/**
...
...
@@ -352,7 +352,7 @@ public:
* \param _roi the resulting ROI
* \return true if ROI exists.
*/
bool
pickEmptyCell
(
Eigen
::
Vector2i
&
_cell
)
bool
pickEmpty
Tracking
Cell
(
Eigen
::
Vector2i
&
_cell
)
{
int
kk
=
0
;
Eigen
::
Vector2i
cell0
;
...
...
@@ -360,7 +360,7 @@ public:
for
(
int
jj
=
1
;
jj
<
n_cell_cols_
;
jj
++
)
{
cell0
(
0
)
=
ii
;
cell0
(
1
)
=
jj
;
if
(
occupancy
_grid_
(
ii
,
jj
)
==
0
)
if
(
tracking
_grid_
(
ii
,
jj
)
==
0
)
{
empty_cells_tile_tmp_
(
0
,
kk
)
=
ii
;
//may be done in a better way
empty_cells_tile_tmp_
(
1
,
kk
)
=
jj
;
...
...
@@ -384,16 +384,16 @@ public:
* in order to avoid searching again in it.
* \param _roi the ROI where nothing was found
*/
void
blockCell
(
Eigen
::
Vector2i
&
cell
)
void
block
Tracking
Cell
(
Eigen
::
Vector2i
&
cell
)
{
occupancy
_grid_
(
cell
(
0
),
cell
(
1
))
=
0
;
tracking
_grid_
(
cell
(
0
),
cell
(
1
))
=
0
;
}
private
:
size_t
n_cell_rows_
,
n_cell_cols_
;
size_t
cell_width_
,
cell_height_
;
Grid
grid_
;
Eigen
::
MatrixXi
occupancy
_grid_
;
Eigen
::
MatrixXi
tracking
_grid_
;
Eigen
::
MatrixXi
empty_cells_tile_tmp_
;
};
...
...
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