0
$\begingroup$

Rosanswers logo

Hi,

I have a Basler camera that outputs bayer pattern images in format7_mode1 mode. However, when I set raw8 for the format7_color_coding parameter, then it fails to be set, and mono8 is used instead. Therefore, the image_proc node cannot debayer the images, because it thinks they are simply grayscale, instead of bayer, as they actually are.

Everything works in coriander (see coriander_bayer.png).

The output of the camera1394 node is

[ INFO] [1341392664.941249990]: using default calibration URL
[ INFO] [1341392664.941737294]: camera calibration URL: file:///home/enrique/.ros/camera_info/camera.yaml
[ERROR] [1341392664.942107239]: Unable to open camera calibration file [/home/enrique/.ros/camera_info/camera.yaml]
[ WARN] [1341392664.942363881]: Camera calibration file /home/enrique/.ros/camera_info/camera.yaml not found.
[ INFO] [1341392665.615791969]: Found camera with GUID 305300013759c6
[ INFO] [1341392665.616241698]: camera model: Basler A102fc
[ INFO] [1341392665.621517490]: Format7 unit size: (2x2), position: (2x2)
[ INFO] [1341392665.621664656]: Format7 region size: (1388x1038), offset: (0, 0)
[ERROR] [1341392665.624025892]: Color coding raw8 not supported by this camera
[ INFO] [1341392665.636889941]: using default calibration URL
[ INFO] [1341392665.637584961]: camera calibration URL: file:///home/enrique/.ros/camera_info/00305300013759c6.yaml
[ERROR] [1341392665.638324312]: Unable to open camera calibration file [/home/enrique/.ros/camera_info/00305300013759c6.yaml]
[ WARN] [1341392665.639039116]: Camera calibration file /home/enrique/.ros/camera_info/00305300013759c6.yaml not found.
[ INFO] [1341392665.639805838]: [00305300013759c6] opened: format7_mode1, 15 fps, 400 Mb/s
[ INFO] [1341392665.640524806]: camera calibration URL: package://cameras_cirs/calibration/basler_a102fc/format7_mode1/00305300013759c6.yaml

The message

Color coding raw8 not supported by this camera

of the output, is generated in modes.cpp file.

IMHO I think the best way to solve this is to allow the image_proc node to debayer mono8 images, so cameras that call mono8 to what should be raw8 are supported.

How can I force to set the raw8 encoding, or just debayer the images? Thanks in advance.

Below you can see the launch and (parameters/config) yaml files I'm using to run the camera driver.

Enrique

basler_a102fc_format7_mode1.yaml # Example camera parameters (for Basler A102fc)

# Parameters (no lens required/used)
guid: 00305300013759c6          # (defaults to first camera on bus)
iso_speed: 400  # IEEE1394a
video_mode: format7_mode1   # 1388x1038 @ 15fps bayer pattern
frame_rate: 15 # max fps (Hz)
format7_color_coding: raw8  # for bayer (we can use others, even rgb8 directly)
# With raw8, we don't need to configure bayer pattern and method, actually we
# cannot change them
bayer_pattern: gbrg
#bayer_method: HQ
auto_brightness: 3 # Manual (3)
brightness: 0
# Is better to increase gain than shutter speed, becuase gain produce salt&pepper
# noise, while shutter speed produce motion blur, which is harder to deal with.
auto_gain: 3 # Manual (3)
gain: 512 # dB unavailable
# See comment above wrt to gain and shutter speed setting.
auto_shutter: 3 # Manual (3)
shutter: 356 # time (ms) unavailable; value for sunlight
auto_white_balance: 3 # Manual (3)
white_balance_BU: 112
white_balance_RV: 64
frame_id: basler_a102fc
camera_info_url: package://cameras_cirs/calibration/basler_a102fc/format7_mode1/${NAME}.yaml

basler_a102fc.launch

<launch>
  <!-- Usage:
  roslaunch cameras_cirs basler_a102fc.launch view:=true
  -->

  <!-- Arguments -->
  <!-- Show video output (both RAW and rectified) -->
  <arg name="view" default="false"/>
  <!-- Camera params (config) -->
  <arg name="params"
       default="$(find cameras_cirs)/params/basler_a102fc/basler_a102fc_format7_mode1.yaml"/>

  <!-- Camera driver -->
  <node pkg="camera1394" type="camera1394_node" name="camera1394_node"
        output="screen">
    <rosparam file="$(arg params)"/>
  </node>

  <!-- Camera image processing (color + rectification) -->
  <node ns="camera" pkg="image_proc" type="image_proc"
        name="image_proc"/>

  <!-- Show video output -->
  <group if="$(arg view)">
    <!-- Image viewer (non-rectified image) -->
    <node pkg="image_view" type="image_view" name="non_rectified_image">
      <remap from="image" to="camera/image_color"/>
    </node>

    <!-- Image viewer (rectified image) -->
    <node pkg="image_view" type="image_view" name="rectified_image">
      <remap from="image" to="camera/image_rect_color"/>
    </node>
  </group>
</launch>

Originally posted by Enrique on ROS Answers with karma: 834 on 2012-07-03

Post score: 2


Original comments

Comment by joq on 2012-07-03:
If it works with coriander, then this is a bug in camera1394. Otherwise, it's a problem with the camera or the IEEE 1394 bus interface. Many cameras have flaky Format7 implementations.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The first thing to try is to run coriander (apt-get install coriander) or other 3rd party software to make sure that this is a ROS related problem. I don't think that camera1394 has any internal logic to detect image type, it just queries the device which then tell whether the format is ok or not.

Could you run camera1394 in a terminal and edit your question to add the exact error message? Could you try to see if other software support correctly the Format 7 mode of your camera?

If you want to debug the code, take a look at src/format7.cpp of camera1394. If there is a bug, it is probably lying around here.

PS: I don't have a FW camera available right now so you may have to use other tools if the format 7 support of coriander is not enough to replicate your issue, but I'm quite confident.


Originally posted by Thomas with karma: 4478 on 2012-07-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Enrique on 2012-07-03:
Yes, it works with coriander. I always try first with it :) That way I know the modes available and I can easily play with the controls and other options. And the format7 modes (0 and 1) are supported. And, sorry, I'd edit the comment in a moment with camera1394 output. Thanks.

Comment by joq on 2012-07-05:
I still do not understand what is happening. Please open a defect ticket, linking back to this question: https://code.ros.org/trac/ros-pkg/newticket?component=camera1394&type=defect&&camera1394

Comment by Thomas on 2012-07-05:
Sorry for not answering after asking for more info, but same as joq. I don't quite get what is happening here... At this point, retrieving camera1394 from git and compiling it to debug manually is your best option...

Comment by joq on 2012-07-06:
Even without recompiling you can turn on debug output with rxconsole. That might give us a clue.

Comment by Enrique on 2012-07-18:
I've just created the ticket: https://code.ros.org/trac/ros-pkg/ticket/5494, but I'm not able to test camera1394 with the same camera; some other guys are using it now, sorry.

Comment by joq on 2014-09-01:
That Trac ticket has been copied to github issue #42: https://github.com/ros-drivers/camera1394/issues/42 . Please respond there is this is still a problem.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.