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
ec9005cb
Commit
ec9005cb
authored
2 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
[skip-ci] check number of channels of image on which to draw
parent
b31b93a4
No related branches found
No related tags found
1 merge request
!4
Devel
Pipeline
#12219
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/publisher_vision.cpp
+12
-4
12 additions, 4 deletions
src/publisher_vision.cpp
with
12 additions
and
4 deletions
src/publisher_vision.cpp
+
12
−
4
View file @
ec9005cb
...
...
@@ -69,9 +69,11 @@ PublisherVisionDebug::PublisherVisionDebug(const std::string &_unique_name,
last_capture_
(
nullptr
),
img_transport_
(
ros
::
NodeHandle
())
{
WOLF_INFO
(
"
\n\n\n\n\n\n\n\n
YOOOOOOOOOOOOOOOOOOOO PublisherVisionDebug"
)
// if user do not provide processor's name, first processor of type PublisherVisionDebug is taken
auto
processor_name
=
getParamWithDefault
<
std
::
string
>
(
_server
,
prefix_
+
"/processor_name"
,
""
);
topic_preprocessor_
=
getParamWithDefault
<
std
::
string
>
(
_server
,
prefix_
+
"/topic_preprocessor"
,
"/
debug_image
_prepocessor"
);
topic_preprocessor_
=
getParamWithDefault
<
std
::
string
>
(
_server
,
prefix_
+
"/topic_preprocessor"
,
"/
image_vo_tracks
_prepocessor"
);
//Tracks
tracks_
.
show_id_
=
getParamWithDefault
<
bool
>
(
_server
,
prefix_
+
"/tracks/show_id"
,
false
);
tracks_
.
size_id_
=
getParamWithDefault
<
double
>
(
_server
,
prefix_
+
"/tracks/size_id"
,
0.5
);
...
...
@@ -142,6 +144,7 @@ bool PublisherVisionDebug::ready()
void
PublisherVisionDebug
::
publishDerived
()
{
WOLF_INFO
(
"YO"
)
if
(
last_capture_
==
processor_vision_
->
getLast
()
or
not
processor_vision_
->
getLast
())
return
;
...
...
@@ -157,9 +160,14 @@ void PublisherVisionDebug::publishDerived()
// Draw and publish debug image
try
{
// Extract cv image
cv
::
Mat
cv_img_debug
;
cv
::
cvtColor
(
cap_img
->
getImage
(),
cv_img_debug
,
cv
::
COLOR_GRAY2BGR
);
// Transform the image to RGB if grayscale so that we can draw detections in color for debugging
cv
::
Mat
cv_img_debug
;
if
(
cap_img
->
getImage
().
channels
()
==
1
){
cv
::
cvtColor
(
cap_img
->
getImage
(),
cv_img_debug
,
cv
::
COLOR_GRAY2BGR
);
}
else
{
cv_img_debug
=
cap_img
->
getImage
().
clone
();
}
// Draw all tracks
...
...
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