Skip to content

Commit

Permalink
Changed to rgb8 encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjelonic committed Nov 20, 2017
1 parent 47c6d55 commit 9f02598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion darknet_ros/config/ros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ publishers:
image_view:

enable_opencv: true
use_darknet: false
use_darknet: true
wait_key_delay: 2
enable_console_output: false
6 changes: 3 additions & 3 deletions darknet_ros/src/YoloObjectDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void YoloObjectDetector::cameraCallback(const sensor_msgs::ImageConstPtr& msg) {
cv_bridge::CvImagePtr cam_image;

try {
cam_image = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
cam_image = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::RGB8);
}
catch (cv_bridge::Exception& e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
Expand All @@ -331,7 +331,7 @@ void YoloObjectDetector::checkForObjectsActionGoalCB() {
cv_bridge::CvImagePtr cam_image;

try {
cam_image = cv_bridge::toCvCopy(imageAction, sensor_msgs::image_encodings::BGR8);
cam_image = cv_bridge::toCvCopy(imageAction, sensor_msgs::image_encodings::RGB8);
}
catch (cv_bridge::Exception& e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
Expand Down Expand Up @@ -363,7 +363,7 @@ bool YoloObjectDetector::publishDetectionImage(const cv::Mat& detectionImage) {
cv_bridge::CvImage cvImage;
cvImage.header.stamp = ros::Time::now();
cvImage.header.frame_id = "detection_image";
cvImage.encoding = sensor_msgs::image_encodings::BGR8;
cvImage.encoding = sensor_msgs::image_encodings::RGB8;
cvImage.image = detectionImage;
detectionImagePublisher_.publish(*cvImage.toImageMsg());
ROS_DEBUG("Detection image has been published.");
Expand Down

0 comments on commit 9f02598

Please sign in to comment.