3 changed files with 38 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
#include <ros/ros.h> |
|||
#include <opencv2/opencv.hpp> |
|||
#include <image_transport/image_transport.h> |
|||
#include <cv_bridge/cv_bridge.h> |
|||
//#include <math.hpp>
|
|||
|
|||
void callback(const sensor_msgs::ImageConstPtr& msg) { |
|||
cv_bridge::CvImagePtr cv_ptr; |
|||
|
|||
try { |
|||
cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::RGB8); |
|||
}catch(cv_bridge::Exception& e) { |
|||
ROS_ERROR("cv_bridge exception: %s", e.what()); |
|||
return; |
|||
} |
|||
|
|||
const cv::Mat& input = cv_ptr->image; |
|||
|
|||
} |
|||
|
|||
int main(int argc, char** argv) { |
|||
ros::init(argc, argv, "descripteur"); |
|||
|
|||
ros::NodeHandle n; |
|||
image_transport::ImageTransport it(n); |
|||
|
|||
image_transport::Subscriber sub = it.subscribe("/image_raw", 1, callback); |
|||
|
|||
ros::spin(); |
|||
} |
|||
Loading…
Reference in new issue