Giter VIP home page Giter VIP logo

video_stream_opencv's Introduction

A package to view video streams based on the OpenCV VideoCapture module, easy way to publish on a ROS Image topic (including camera info) usb cams, ethernet cameras, video streams or video files. It also supports flipping of images.

Screenshot of the plugin working with a webcam, video stream and video file

Example usages in launch folder (only the argument video_stream_provider is mandatory):

<launch>
   <!-- launch video stream -->
   <include file="$(find video_stream_opencv)/launch/camera.launch" >
        <!-- node name and ros graph name -->
        <arg name="camera_name" value="webcam" />
        <!-- means video device 0, /dev/video0 -->
        <arg name="video_stream_provider" value="0" />
        <!-- throttling the querying of frames to -->
        <arg name="fps" value="30" />
        <!-- setting frame_id -->
        <arg name="frame_id" value="webcam" />
        <!-- camera info loading, take care as it needs the "file:///" at the start , e.g.:
        "file:///$(find your_camera_package)/config/your_camera.yaml" -->
        <arg name="camera_info_url" value="" />
        <!-- flip the image horizontally (mirror it) -->
        <arg name="flip_horizontal" value="false" />
        <!-- flip the image vertically -->
        <arg name="flip_vertical" value="false" />
        <!-- force a width and height, 0 means no forcing -->
        <arg name="width" value="640"/>
        <arg name="height" value="480"/>
        <!-- visualize on an image_view window the stream generated -->
        <arg name="visualize" value="true" />
   </include>
</launch>

Based on the ROS tutorial to convert opencv images to ROS messages.

===

You can use any input that OpenCV on your system accepts, e.g.:

  • Video devices that appear in linux as /dev/videoX, e.g.: USB webcams appearing as /dev/video0

  • Video streamings, e.g.: rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

  • Video files, anything you can play, e.g.: myvideo.avi

  • Etc.

===

In the scripts folder you'll find test_video_resource.py which you can use to test if your system installation can use this node to open your video stream (not using any ROS). Just do any of those:

./test_video_resource.py 0
./test_video_resource.py rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
./test_video_resource.py /home/youruser/myvideo.mkv

And you'll see an output like:

Trying to open resource: /dev/video0
Correctly opened resource, starting to show feed.

With an OpenCV image show window showing the stream (which should close when pressing ESC, or Control+C the shell).

video_stream_opencv's People

Contributors

awesomebytes avatar senden9 avatar wiebevr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.