Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob detection nodelet #130

Open
wants to merge 19 commits into
base: indigo
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
robotont-10 committed Jan 29, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ba308a41baa9db4c21d1733e0b03e1c8d489c26e
7 changes: 7 additions & 0 deletions src/nodelet/blob_detection_nodelet.cpp
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ namespace opencv_apps
class BlobDetectionNodelet : public opencv_apps::Nodelet
{
image_transport::Publisher img_pub_;
image_transport::Publisher thresholded_img_pub_;
image_transport::Subscriber img_sub_;
image_transport::CameraSubscriber cam_sub_;
ros::Publisher msg_pub_;
@@ -559,8 +560,13 @@ class BlobDetectionNodelet : public opencv_apps::Nodelet

// Publish the image.
// Publish the image.
cv::Mat out_thresholded_image;
cv::cvtColor(thresholded_image, out_thresholded_image, cv::COLOR_GRAY2BGR);
sensor_msgs::Image::Ptr out_img = cv_bridge::CvImage(msg->header, "bgr8", out_image).toImageMsg();
sensor_msgs::Image::Ptr out_thresholded_img = cv_bridge::CvImage(msg->header, "bgr8", out_thresholded_image).toImageMsg();

img_pub_.publish(out_img);
thresholded_img_pub_.publish(out_thresholded_img);
msg_pub_.publish(blobs_msg); //s
}
catch (cv::Exception& e)
@@ -622,6 +628,7 @@ class BlobDetectionNodelet : public opencv_apps::Nodelet
reconfigure_server_->setCallback(f);

img_pub_ = advertiseImage(*pnh_, "image", 1);
thresholded_img_pub_ = advertiseImage(*pnh_, "thresholded_image", 1);
msg_pub_ = advertise<opencv_apps::BlobArrayStamped>(*pnh_, "blobs", 1);

onInitPostProcess();