A display question about Opencv&ROS
Hello , I am learning how to use OpenCV in ROS recently , now I meet a question about display the image . Here is my code :
ROS_INFO_STREAM("node1");
cv::namedWindow("test",1);
ROS_INFO_STREAM("node2");
But after I run the code , there is not window display . The terminal just print these information :
[ INFO] [1407293765.605951849]: node1
[ INFO] [1407293765.629249378]: node2
I can not understand why . Can you help me ? Thank you !
does it show when you add cd::waitKey(0); after cv::namedWindow ?
Yes , It occurs . But why ? I wrote " ros::spin() " at the end of "int main(...) ", does the code running in a loop ?
I ran the code in http://wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages , it still did not occur the window .