27 #include <opencv2/imgproc/imgproc.hpp>
28 #include <opencv2/highgui/highgui.hpp>
32 #include <sensor_msgs/Image.h>
33 #include <sensor_msgs/CameraInfo.h>
34 #include <image_transport/image_transport.h>
44 ROS_ERROR(
"Signal %d caught...",sig);
45 cout<<
"Shuting down road_recognition"<<endl;
49 void Callback(
const sensor_msgs::CameraInfoPtr& cam_info)
51 cout<<
"---> Camera configurations"<<endl;
52 cout<<
"imge size "<<endl<<
"\t"<<cam_info->height<<
" x "<<cam_info->width<<endl;
53 cout<<
"distortion_model:"<<endl<<
"\t"<<cam_info->distortion_model<<endl;
58 cout<<
"focal lengths"<<endl<<
"\t fx ="<<cam_info->K[0]<<
" fy = "<<cam_info->K[4]<<endl;
59 cout<<
"principal point"<<endl<<
"\t cx ="<<cam_info->K[2]<<
" cy = "<<cam_info->K[5]<<endl;
62 cout<<
"---> Camera configurations Updated"<<endl;
66 int main(
int argc,
char **argv)
68 ros::init(argc, argv,
"demo");
76 ros::Subscriber sub = nh.subscribe(
"/snr/scam/wide/left/camera_info", 1,
Callback);
78 ROS_INFO(
"Caltech::main.cpp::No error.");
int main(int argc, char **argv)
void Callback(const sensor_msgs::CameraInfoPtr &cam_info)