sudo apt-get install libopencv-dev
Then I would suggest using python first. All you need to do is to import opencv in the top of your python script.
import cv2
and then do whatever you want. Opencv functions can be called in ROS callbacks. Most interesting thing would be probably converting ROS image messages to opencv format as explained here. This would allow applying image processing algorithms implemented in opencv on the images you get from ROS.
Originally posted by Mehdi. with karma: 3339 on 2016-05-10
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Astronaut on 2016-05-10:
Thanks. Im not familiar with python actually. is any option for using C++?
Comment by Airuno2L on 2016-05-11:
Yes, you can use OpenCV with C++. Installing it is done the same way.
Comment by Mehdi. on 2016-05-11:
Here is an example to publish webcam images using opencv and ros
Comment by Astronaut on 2016-05-12:
Thanks,. I followed the example. when tried to run make I got the following error:
/usr/bin/ld: cannot find -lcv_bridge
I already installed before the cv_bridge package. Should I modify my CmakeList as well?Any help?
Comment by Mehdi. on 2016-05-12:
you run make or catkin_make ?
Comment by Astronaut on 2016-05-12:
I am using rosbuild. So I run make
Comment by Mehdi. on 2016-05-12:
rosmake + package_name
Comment by Astronaut on 2016-05-12:
No. It does not work. error again
Comment by Astronaut on 2016-05-16:
ok. fix it. work now.
Comment by Astronaut on 2016-05-18:
Do you know any launch file to run the node?
Comment by Astronaut on 2021-04-05:
Ok. I was the opencv version problem. Ok now