ROS package to estimate optical flow by PWC-Net.
This uses model definition and trained model from official implementation by Caffe. The model is fine-tuned by Sintel, KITTI, and HD1K dataset.
-
Nvidia GPU
-
Docker
-
Docker Compose
-
nvidia-container-toolkit and nvidia-docker2
nvidia-docker2 is deprecated but it is needed for Docker Compose with GPU
$ git clone https://github.com/fujimo-t/pwc_net_ros.git
$ cd pwc_net_ros/docker
$ xhost +local:root # To use GUI, see http://wiki.ros.org/docker/Tutorials/GUI#The_simple_way
$ docker-compose up
Then containers is launched:
- ROS master
- rqt
- terminal
- To run command and ROS nodes
To test pwc_net_ros, execute follow command in the container terminal:
$ roslaunch pwc_net sample.launch
Use this library to estimate optical flow.
You can know how to use it by reading source code of sample_node
A node estimates dense optical flow from image topic.
-
image
(sensor_msgs/Image)Input image should be remapped. Optical flow is estimated between latest image and it's previous image.
-
optical_flow
(sensor_msgs/Image)Estimated optical flow.
encoding
is32FC2
(32bit float, 2 channels). First channel is optical flow's x-axis component, second is y-axis. -
visualized_optical_flow
(sensor_msgs/Image)Visualized optical flow as BGR image to see on normal image viewer such as RViz.
-
~image_transport
(string, default: "raw")Transport used for the image stream. See image_transport.
See LICENSE.
This repository doesn't directly contain PWC-Net code but used with it. See LICENSE.md about PWC-Net's license.