<commit_before>#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>

#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>

class ImageBlurer {
public:
  ImageBlurer();
  void blur_image(const sensor_msgs::ImageConstPtr& msg);
private:
  ros::NodeHandle nh_;
  ros::NodeHandle pnh_;
  image_transport::ImageTransport it_;
  image_transport::ImageTransport pit_;
  image_transport::Subscriber image_sub_;
  image_transport::Publisher image_pub_;
};

ImageBlurer::ImageBlurer()
  : nh_{},
    pnh_{"~"},
    it_{nh_},
    pit_{pnh_},
    image_sub_{it_.subscribe("src_image", 1, &ImageBlurer::blur_image, this)},
    image_pub_{pit_.advertise("dest_image", 1)}
{
}

void ImageBlurer::blur_image(const sensor_msgs::ImageConstPtr& msg)
{
  try {
    cv::Mat dest_image;
    cv::blur(cv_bridge::CvImagePtr{cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::BGR8)}->image, dest_image, cv::Size(2, 100));
    image_pub_.publish(cv_bridge::CvImage{std_msgs::Header{}, "bgr8", dest_image}.toImageMsg());
  }
  catch (cv_bridge::Exception& e) {
    ROS_ERROR_STREAM("cv_bridge exception: " << e.what());
  }
}

int main(int argc, char** argv)
{
  ros::init(argc, argv, "image_blurer");
  ImageBlurer ib{};
  ros::spin();
  return 0;
}<commit_msg>Avoid to make extra rvalue<commit_after>#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>

#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>

class ImageBlurer {
public:
  ImageBlurer();
  void blur_image(const sensor_msgs::ImageConstPtr& msg);
private:
  ros::NodeHandle nh_;
  ros::NodeHandle pnh_;
  image_transport::ImageTransport it_;
  image_transport::ImageTransport pit_;
  image_transport::Subscriber image_sub_;
  image_transport::Publisher image_pub_;
};

ImageBlurer::ImageBlurer()
  : nh_{},
    pnh_{"~"},
    it_{nh_},
    pit_{pnh_},
    image_sub_{it_.subscribe("src_image", 1, &ImageBlurer::blur_image, this)},
    image_pub_{pit_.advertise("dest_image", 1)}
{
}

void ImageBlurer::blur_image(const sensor_msgs::ImageConstPtr& msg)
{
  try {
    cv::Mat dest_image;
    cv::blur(cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::BGR8)->image, dest_image, cv::Size(2, 100));
    image_pub_.publish(cv_bridge::CvImage{std_msgs::Header{}, "bgr8", dest_image}.toImageMsg());
  }
  catch (cv_bridge::Exception& e) {
    ROS_ERROR_STREAM("cv_bridge exception: " << e.what());
  }
}

int main(int argc, char** argv)
{
  ros::init(argc, argv, "image_blurer");
  ImageBlurer ib{};
  ros::spin();
  return 0;
}
{'fraction_non_alphanumeric': 0.15777610818933133, 'fraction_numerical': 0.008264462809917356, 'mean_word_length': 6.101333333333334, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6906523', 'n_tokens_mistral': 1033, 'n_tokens_neox': 995, 'n_words': 160}