Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wolf_ros_vision
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
mobile_robotics
wolf_projects
wolf_ros
wolf_ros_vision
Commits
b51b3cc7
Commit
b51b3cc7
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
tune luminosity code
parent
9f635a78
No related branches found
No related tags found
2 merge requests
!3
After cmake and const refactor
,
!1
Resolve "Publisher for visual odometry"
Pipeline
#9671
failed
3 years ago
Stage: license
Stage: build_and_test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/publisher_vision.cpp
+10
-8
10 additions, 8 deletions
src/publisher_vision.cpp
with
10 additions
and
8 deletions
src/publisher_vision.cpp
+
10
−
8
View file @
b51b3cc7
...
...
@@ -47,7 +47,7 @@ PublisherVisionDebug::PublisherVisionDebug(const std::string &_unique_name,
last_capture_
(
nullptr
),
it_
(
ros
::
NodeHandle
())
{
// if user do not provide processor's name, first processor of type P
rocessorTrackerLandmarkAprilta
g is taken
// if user do not provide processor's name, first processor of type P
ublisherVisionDebu
g is taken
auto
processor_name
=
getParamWithDefault
<
std
::
string
>
(
_server
,
prefix_
+
"/processor_name"
,
""
);
// search the processor
...
...
@@ -167,23 +167,25 @@ std::vector<int> PublisherVisionDebug::colorTrackAndFeatures(int _nb_feature_in_
// std::cout << "_max_feature_in_tracks: " << _max_feature_in_tracks << '\n';
if
(
_max_feature_in_tracks
!=
_min_feature_in_tracks
)
{
alpha
=
(
(
double
)
_nb_feature_in_track
-
_min_feature_in_tracks
)
/
(
_max_feature_in_tracks
-
_min_feature_in_tracks
);
// to interval [0,1]
alpha
=
(
double
)
(
_nb_feature_in_track
-
_min_feature_in_tracks
)
/
(
double
)
(
_max_feature_in_tracks
-
_min_feature_in_tracks
);
// to interval [0,1]
}
else
{
alpha
=
0.5
;
// put "half luminosity as a default value"
alpha
=
1.0
;
// put "full luminosity as a default value"
// alpha = 0.5; // put "half luminosity as a default value"
}
if
((
_min_lum
+
(
_max_lum
-
_min_lum
)
*
(
1
-
alpha
))
>
255
)
double
lum
=
(
_min_lum
+
(
_max_lum
-
_min_lum
)
*
alpha
);
if
(
lum
>
255
)
{
color
[
0
]
=
255
;
color
[
1
]
=
round
(
_min_lum
+
(
_max_lum
-
_min_lum
)
*
(
1
-
alpha
)
)
-
255
;
color
[
2
]
=
round
(
_min_lum
+
(
_max_lum
-
_min_lum
)
*
(
1
-
alpha
)
)
-
255
;
color
[
1
]
=
round
(
lum
)
-
255
;
color
[
2
]
=
round
(
lum
)
-
255
;
}
else
{
color
[
0
]
=
round
(
_min_lum
+
(
_max_lum
-
_min_lum
)
*
(
1
-
alpha
)
);
color
[
0
]
=
round
(
lum
);
color
[
1
]
=
0
;
color
[
2
]
=
0
;
}
...
...
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