src/object_detection_2d/src/ros_filter_wrapper.cpp
/*
 * Convert message to cv-image, filter the image, convert it back to a message,
 * and publish it.
 */
Convert message to cv-image, filter the image, convert it back to a message,
and publish it.
Convert message to cv - image filter the image convert it back to a message and publish it .
void ROSFilterWrapper::processImageMsg(const sensor_msgs::Image::ConstPtr& image_msg) const
{
  cv_bridge::CvImagePtr cv_image =
      cv_bridge::toCvCopy(image_msg, sensor_msgs::image_encodings::BGR8);
  cv_image->image = filter_->filter(cv_image->image);
  pub_.publish(cv_image->toImageMsg());
}
void ROSFilterWrapper :: processImageMsg ( const sensor_msgs :: Image :: ConstPtr & image_msg ) const { cv_bridge :: CvImagePtr cv_image = cv_bridge :: toCvCopy ( image_msg , sensor_msgs :: image_encodings :: BGR8 ) ; cv_image -> image = filter_ -> filter ( cv_image -> image ) ; pub_ . publish ( cv_image -> toImageMsg ( ) ) ; }
Convert message to cv-image, filter the image, convert it back to a message,
 and publish it.
Convert message to cv - image filter the image convert it back to a message and publish it .