2019-05-19から1日間の記事一覧

ROS MelodicでOpenCV(テニスボールの位置検出)

前回ROS MelodicでOpenCV - 機械屋の呟き、ROS上でOpenCVを使う準備をしたので、実際に使ってみます。 サンプルコード 以下のコードをopencv_test.cppに書き、ビルドします。 #include <ros/ros.h> #include <image_transport/image_transport.h> #include <cv_bridge/cv_bridge.h> #include <sensor_msgs/image_encodings.h> #include <opencv2/imgproc/imgproc.hpp> #include </opencv2/imgproc/imgproc.hpp></sensor_msgs/image_encodings.h></cv_bridge/cv_bridge.h></image_transport/image_transport.h></ros/ros.h>