Go to the documentation of this file.00001 #include <image_transport_tutorial/resized_subscriber.h>
00002 #include <cv_bridge/cv_bridge.h>
00003 #include <opencv2/imgproc/imgproc.hpp>
00004
00005 void ResizedSubscriber::internalCallback(const image_transport_tutorial::ResizedImage::ConstPtr& msg,
00006 const Callback& user_cb)
00007 {
00008
00009 boost::shared_ptr<void const> tracked_object_tmp;
00010 cv::Mat img_rsz = cv_bridge::toCvShare(msg->image, tracked_object_tmp)->image;
00011
00012 cv::Mat img_restored;
00013 cv::resize(img_rsz, img_restored, cv::Size(msg->original_width, msg->original_height));
00014
00015
00016 cv_bridge::CvImage cv_img(msg->image.header, msg->image.encoding, img_restored);
00017 user_cb(cv_img.toImageMsg());
00018 };