Ask Your Question

How I can run contour_moments.cpp OpenCV example?

asked 2015-12-12 18:48:00 -0500

G212 gravatar image

updated 2017-04-10 09:21:01 -0500

Kei Okada gravatar image

I don’t know how to run the file contour_moments.cpp that’s able in this github link:

I’m working with Indigo and I have installed OpenCV3 following this link:

when i run the command rosrun opencv_apps contour_moments it only appear a warning and nothing else:

[ WARN] [1450293289.992148166]: Topic 'image' has not been remapped! Typical command-line usage:
    $ rosrun image_rotate image_rotate image:=<image topic> [transport]

which topic should I use?? (I'm using a kinect, and it is working fine)

edit retag flag offensive close merge delete


paste the errors here then

clynamen gravatar imageclynamen ( 2015-12-13 07:22:40 -0500 )edit

The required target_link_libraries are listed in the CMakeLists.txt file in the repository.

clynamen gravatar imageclynamen ( 2015-12-13 07:23:42 -0500 )edit

It might be easier to start with the entire vision_opencv package and progressively remove things from it until it is only building contour_moments. Don't use OpenCV 3 unless you really need it instead of 2.4, building with it has some issues.

lucasw gravatar imagelucasw ( 2015-12-14 12:51:14 -0500 )edit

Ok, so I have to uninstall OpenCV3 before installing Opencv2? .. If so, how do I do that?

G212 gravatar imageG212 ( 2015-12-14 13:54:03 -0500 )edit

OpenCV 2 is probably already installed in parallel if you have cv_bridge installed. If you have OpenCV 3 from debian/ubuntu packages sudo apt-get remove ros-indigo-opencv3

lucasw gravatar imagelucasw ( 2015-12-14 19:47:29 -0500 )edit

ok, now when i run the command rosrun opencv_apps contour_moments it only appear a warning and nothing else ...

G212 gravatar imageG212 ( 2015-12-16 13:32:53 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-04-10 09:10:00 -0500

Kei Okada gravatar image

These nodes do not publish any message unless someone is reading that. so try roslaunch opencv_apps contour_moments.launch image:=image_raw and rostopic echo /contour_moments/moment

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-12 18:48:00 -0500

Seen: 207 times

Last updated: Apr 10 '17