arrow_detection_v2.cpp
Go to the documentation of this file.
1 
2 #include <ros/ros.h>
3 
4 #include <visp/vpImage.h>
5 #include <visp/vpDisplayX.h>
6 #include <visp_ros/vpROSGrabber.h>
7 
8 using namespace std;
9 
10 int main(int argc,char**argv)
11 {
12  vpImage<unsigned char> I;
13 
14  vpROSGrabber g;
15  g.setImageTopic("/camera/image_raw");
16  g.open(I);
17 
18  vpDisplayX d(I);
19 
20  ros::spinOnce();//necessary for catking include ros libraries
21 
22  while(ros::ok())
23  {
24  g.acquire(I);
25  vpDisplay::display(I);
26  vpDisplay::flush(I);
27 
28  if (vpDisplay::getClick(I, false))
29  break;
30 
31  }
32 
33  return 0;
34 }
35 
36 
37 //#include <visp/vpDisplayX.h>
38 //#include <visp/vpImage.h>
39 // #include <ros/ros.h>
40 //
41 // #include <visp_ros/vpROSGrabber.h>
42 // #include <iostream>
43 // using namespace std;
44 //
45 // int main(int argc,char**argv)
46 // {
47 // ros::init( argc, argv, "arrow_detection_v2" );
48 //
49 // cout<<"i'm alive"<<endl;
50 // vpROSGrabber g;
51 //
52 // return 0;
53 
54  //try {
56  //vpImage<vpRGBa> I; // Create a color image container
57 // vpROSGrabber g; // Create a grabber based on ROS
58 
59  //g.setCameraInfoTopic("/camera/camera_info");
60  //g.setImageTopic("/camera/image_raw");
61  //g.setRectify(true);
62  //g.open(I);
63  //std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
64 
65 //#ifdef VISP_HAVE_X11
67 //#else
68  //std::cout << "No image viewer is available..." << std::endl;
69 //#endif
70 
71  //while(1) {
72  //g.acquire(I);
77  //}
78  //}
79  //catch(vpException e) {
80  //std::cout << "Catch an exception: " << e << std::endl;
81  //}
82 // }
83 
84 //#include <visp/vpImage.h>
86 //#include <visp_ros/vpROSGrabber.h>
87 //#include <visp_ros/vpROSRobot.h>
88 
94 
95 
96 //int main()
97 //{
98  //vpImage<unsigned char> I;
102 
103  //vpROSGrabber g;
104  //g.setImageTopic("/camera/image_raw");
105  //g.open(I);
106 
107  //while(1) {
108  //g.acquire(I);
113  //}
114 //}
115 
117  //Software License Agreement (BSD License)
118 
119  //Copyright (c) 2011-2014, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
120  //All rights reserved.
121 
122  //Redistribution and use in source and binary forms, with or without modification, are permitted
123  //provided that the following conditions are met:
124 
125  //*Redistributions of source code must retain the above copyright notice, this list of
126  //conditions and the following disclaimer.
127  //*Redistributions in binary form must reproduce the above copyright notice, this list of
128  //conditions and the following disclaimer in the documentation and/or other materials provided
129  //with the distribution.
130  //*Neither the name of the University of Aveiro nor the names of its contributors may be used to
131  //endorse or promote products derived from this software without specific prior written permission.
132 
133  //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
134  //IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
135  //FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
136  //CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
137  //DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
138  //DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
139  //IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
140  //OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
141 //***************************************************************************************************/
142 
143 //#include <iostream>
144 //#include <string>
145 
146 //#include <ros/ros.h>
147 
148 //#include <datamatrix_detection/DatamatrixMsg.h>
149 
150 //#include <image_transport/image_transport.h>
151 //#include <cv_bridge/cv_bridge.h>
152 //#include <sensor_msgs/image_encodings.h>
153 
154 //#include <opencv2/imgproc/imgproc.hpp>
155 //#include <opencv2/highgui/highgui.hpp>
156 
157 //#include <dmtx.h>
158 
159 
161 //#include <visp/vpImage.h>
162 //#include <visp/vpROSGrabber.h>
163 //#include <visp/vpROSRobot.h>
164 
165 //#include <visp/vpDisplayX.h>
166 //#include <visp/vpMbEdgeKltTracker.h>
167 //#include <visp/vpMbKltTracker.h>
168 //#include <visp/vpMbEdgeTracker.h>
169 //#include <visp/vpTime.h>
170 
171 //#include <visp/vpCameraParameters.h>
172 //#include <sensor_msgs/CameraInfo.h>
173 
174 //#include <visp_bridge/camera.h>
175 //#include <visp_bridge/image.h>
176 //#include <visp_bridge/3dpose.h>
177 
179 
180 //#include "resource_retriever/retriever.h"
181 
182 //#include "std_msgs/Int8.h"
183 
184 
185 //class ImageConverter
186 //{
187  //ros::NodeHandle nh_;
189 
190  //image_transport::ImageTransport it_;
191  //image_transport::Subscriber image_sub_;
192 
194 
195 //public:
196  //ImageConverter()
197  //: it_(nh_)
198  //{
200  //image_sub_ = it_.subscribe("/camera/image_raw", 1,
201  //&ImageConverter::imageCallback, this);
203  //}
204 
205  //~ImageConverter()
206  //{
207 
208  //}
209  //void imageCallback(const sensor_msgs::ImageConstPtr& msg)
210  //{
211  //vpImage<unsigned char> I; //cesar
212  //I = visp_bridge::toVispImage (*msg);//cesar
213 
214  //cv_bridge::CvImagePtr cv_ptr;
215  //try
216  //{
217  //cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
218  //}
219  //catch (cv_bridge::Exception& e)
220  //{
221  //ROS_ERROR("cv_bridge exception: %s", e.what());
222  //return;
223  //}
224  //*
225  //DatamatrixDecode(cv_ptr->image,cv_ptr->header);*/
226 
227 
229  //cv::imshow("Image", cv_ptr->image);
230  //cv::waitKey(3);
231 
232  //}
233 
234 
235 //};
236 
237 //int main(int argc, char** argv)
238 //{
239  //ros::init(argc, argv, "datamatrix_detection");
240  //ImageConverter ic;
241  //ros::spin();
242  //return 0;
243 //}
int main(int argc, char **argv)


arrow_detection
Author(s): César Sousa
autogenerated on Mon Mar 2 2015 01:31:21