ros-drivers / video_stream_opencv

A package to open video streams and publish them in ROS using the opencv videocapture mechanism
229 stars 160 forks source link

normalize properties to fix issues after upgrading OpenCV #102

Open machinekoder opened 3 years ago

machinekoder commented 3 years ago

OpenCV 4 (e.g. in Ubuntu bionic with ROS noetic) disables the normalize-properties feature in the V4L2 driver per default. This patch re-enables to old behavior.

See also https://github.com/ros-drivers/video_stream_opencv/issues/92

marcelino-pensa commented 2 years ago

Not sure if anyone is still monitoring this one year later, but I appreciate the solution, I tested it locally and it worked. I just had to make sure to send the desired camera parameters in the launch file. To that end, I appended the following to the launch file that launches video_stream_opencv:

    <!-- Camera params -->
    <param name="auto_exposure" value="True" />

    <!-- The params below are in the range: [0.0, 1.0] -->
    <!-- You should start with default values and renormalize it to the range [0.0, 1.0] -->
    <!-- You can get the default values for a given camera with the command line command from: -->
    <!-- https://people.eng.unimelb.edu.au/pbeuchat/asclinic/software/workflow_usb_camera_settings.html#display-everything-about-a-device -->
    <param name="brightness" value="0.5" />
    <param name="contrast" value="0.5" />
    <param name="hue" value="0.5" />
    <param name="saturation" value="0.46875" />