34 #include <opencv2/core/core.hpp> 37 #include <sensor_msgs/Image.h> 58 std::vector<double> transform;
68 NODELET_INFO(
"No ~width and ~height parameters given. Output images will be same size as input.");
70 priv.
param(
"transform", transform, transform);
71 if (transform.size() != 9)
73 NODELET_FATAL(
"~transform must be a 9-element list of doubles (3x3 matrix, row major)");
78 m_ = cv::Mat(transform,
true).reshape(0, 3);
95 cv::warpPerspective(cv_image->image, cv_warped->image,
m_,
output_size_, CV_INTER_LANCZOS4);
97 cv_warped->encoding = cv_image->encoding;
98 cv_warped->header = cv_image->header;
CvImageConstPtr toCvShare(const sensor_msgs::ImageConstPtr &source, const std::string &encoding=std::string())
Subscriber subscribe(const std::string &base_topic, uint32_t queue_size, const boost::function< void(const sensor_msgs::ImageConstPtr &)> &callback, const ros::VoidPtr &tracked_object=ros::VoidPtr(), const TransportHints &transport_hints=TransportHints())
#define NODELET_INFO_STREAM(...)
ros::NodeHandle & getNodeHandle() const
Publisher advertise(const std::string &base_topic, uint32_t queue_size, bool latch=false)
ros::NodeHandle & getPrivateNodeHandle() const
image_transport::Publisher image_pub_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
SWRI_NODELET_EXPORT_CLASS(swri_image_util, DrawPolygonNodelet)
void publish(const sensor_msgs::Image &message) const
bool hasParam(const std::string &key) const
#define NODELET_INFO(...)
static bool getParam(const ros::NodeHandle &nh, const std::string &name, int &variable)
void handleImage(sensor_msgs::ImageConstPtr const &image)
#define NODELET_FATAL(...)
image_transport::Subscriber image_sub_