GithubHelp home page GithubHelp logo

d3dx13 / cv_camera Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 1.32 MB

cv_camera - ROS OpenCV camera driver supporting fisheye and pinhole distortion correction

License: BSD 3-Clause "New" or "Revised" License

CMake 8.16% C++ 91.84%
fisheye fisheye-undistorting opencv ros undistortion

cv_camera's Introduction

ROS OpenCV camera driver supporting fisheye and pinhole distortion correction

The solution was based on "https://github.com/Skammi/cv_camera", a fork of "https://github.com/OTL/cv_camera"

It is very easy to capture video device if we use cv::VideoCapture of OpenCV.

If you are searching ROS2 driver, check here

cv_camera_node

This node uses camera_info_manager for dealing with camera_info. If no calibration data is set, it has dummy values except for width and height.

Example with distortion correction

rosrun cv_camera cv_camera_node _image_width:=640 _cv_cap_prop_frame_width:=640 _image_height:=480 _cv_cap_prop_frame_height:=480 _rate:=30 _cv_cap_prop_fps:=30 _rescale_camera_info:=true _camera_info_url:="file:///home/${USER}/640x480.yaml"  _undistorted_fov_scale:=1.0 _undistorted_resolution_scale:=1.0 _undistorted_on:=true

Publish

  • ~image_raw (sensor_msgs/Image)
  • ~camera_info (sensor_msgs/CameraInfo)

Service

  • ~set_camera_info (sensor_msgs/SetCameraInfo)

Parameters

  • ~rate (double, default: 30.0) – publish rate [Hz].
  • ~device_id (int, default: 0) – capture device id.
  • ~device_path (string, default: "") – path to camera device file, e. g. /dev/video0.
  • ~frame_id (string, default: "camera") – frame_id of message header.
  • ~image_width (int) – try to set capture image width.
  • ~image_height (int) – try to set capture image height.
  • ~camera_info_url (string) – url of camera info yaml.
  • ~file (string, default: "") – if not "" then use movie file instead of device.
  • ~capture_delay (double, default: 0) – estimated duration of capturing and receiving the image.
  • ~rescale_camera_info (bool, default: false) – rescale camera calibration info automatically.
  • ~camera_name (bool, default: same as frame_id) – camera name for camera_info_manager.
  • ~flip_image (bool, default: false) – flip the image according to image_flip_code.
  • ~image_flip_code (int, default: -1) – code to flip the image see cv::flip() for description.
  • ~undistorted_on (bool, default: false) – if true, then distortion will be removed from the image before publishing to the topics, and the distortion matrices will be corrected according to the new parameters.
  • ~undistorted_fov_scale (double, default: 1.0) – coefficient of multiplication of camera angle of view after distortion removal.
  • ~undistorted_resolution_scale (double, default: 1.0) – coefficient of change of resolution in relation to the initial one after distortion removal. We recommend choosing undistorted_resolution_scale=undistorted_fov_scale if you want to keep all the details in the image.

Supports CV_CAP_PROP_*, by below params.

  • ~cv_cap_prop_pos_msec (double)
  • ~cv_cap_prop_pos_avi_ratio (double)
  • ~cv_cap_prop_frame_width (double)
  • ~cv_cap_prop_frame_height (double)
  • ~cv_cap_prop_fps (double)
  • ~cv_cap_prop_fourcc (double)
  • ~cv_cap_prop_frame_count (double)
  • ~cv_cap_prop_format (double)
  • ~cv_cap_prop_mode (double)
  • ~cv_cap_prop_brightness (double)
  • ~cv_cap_prop_contrast (double)
  • ~cv_cap_prop_saturation (double)
  • ~cv_cap_prop_hue (double)
  • ~cv_cap_prop_gain (double)
  • ~cv_cap_prop_exposure (double)
  • ~cv_cap_prop_convert_rgb (double)
  • ~cv_cap_prop_rectification (double)
  • ~cv_cap_prop_iso_speed (double)

And supports any props. Thanks to Hernan Badino!

  • ~property_$(i)_code (int) – set this code property using ~property_$(i)_value, $(i) must start from 0.
  • ~property_$(i)_value (double) – the value to be set to ~property_$(i)_code

If you want to set the property which code is 404 as 1,

rosrun cv_camera cv_camera_node _property_0_code:=404 _property_0_value:=1

If you want to set more, use ~property_1_code and ~property_1_value.

Nodelet

This node works as nodelet (cv_camera/CvCameraNodelet).

Contributors

PR is welcome. I'll review your code to keep consistency, be patient.

  • Oleg Kalachev
  • Mikael Arguedas
  • Maurice Meedendorp
  • Max Schettler
  • Lukas Bulwahn

cv_camera's People

Contributors

bulwahn avatar d3dx13 avatar mgmeedendorp avatar mikaelarguedas avatar okalachev avatar otl avatar sfalexrog avatar sgermanserrano avatar skammi avatar timple avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.