cvLoadImage fail in ROS.
Hi Everyone: I tried to load a static image in ROS: here is the part of code: #include <highgui.h> #include <cv.h> using namespace std; using namespace cv;
int main (int argc, char** argv) {
...........................
if( ! cvLoadImage("13_45_07-65.bmp") ) cout << "sorry" << endl;
............................
}
in the log file, I can find a " sorry ", which means the image is not successfully loaded.
the code works well outside ros. I put it in ROS because I need the images to tell when to send geometry_msg.
I use ROS electric and configure OpenCV-2.3.1 according to http://www.ros.org/wiki/opencv2.
OpenCV is used with ROS as a rosdep system dependency
I put the followings in the CMakeLists.txt of the package the code is in.
" find_package(OpenCV REQUIRED)
if(OpenCV_FOUND) message("====== Found ${OpenCV_VERSION} =======") message("=== ${OpenCV_LIBS}======") endif(OpenCV_FOUND) "
the cmake .. returns: ====== Found 2.3.1 ======= === opencv_gpu;opencv_contrib;opencv_legacy;opencv_objdetect;opencv_calib3d;opencv_features2d;opencv_video;opencv_highgui;opencv_ml;opencv_imgproc;opencv_flann;opencv_core======
I have no idea why this simple OpenCV command in my code cannot be executed in ROS. Anyone can help me? Thank you in advance.
Yucong