ROS iamge to opencv image and image processing [closed]
Hello,
I follow the tutorials of cvbridge, and now I can get the opencv image from ROS image. Then I want to do some image processing, it seems that I should add the image processing function in the callback function? I try to do in this way and compile it, then rosrun the node, but it always show "Segmentation fault (core dumped)".
So I try another way, I want export the opencv image in the way like the tutorial and then write a new .cpp file to processing with the opencv iamge. But there are always problem, so how can I export the CvImage from ROS image and use it in another .cpp file?
Thank you!
Can you run your code with the gnu debugger (gdb)?
Further, what you're describing sounds exactly like the tutorial code (see link), is there something specific that didn't work http://www.ros.org/wiki/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages (My guess is that there's a memory issue that is caused..)
Thank you for your reply! I try to put all the image processing function and mouse callback fuction in the callback function of subscribe message. It seems work, but there are still several problems......I mean, I have try to do image processing with my webcam, it works, but I try move to ROS now
It seems that dealing with ROS image is inconvenient because I am limited to the callback function?
The use of a callback function should not limit how you solve a problem. It is just a means of performing a fixed action whenever a new image is received.