ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Force raw8 for debayering

asked 2012-07-03 07:36:43 -0500

Enrique gravatar image

updated 2012-07-03 23:34:14 -0500

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 ...
(more)
edit retag flag offensive close merge delete

Comments

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.

joq gravatar image joq  ( 2012-07-03 16:24:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-07-03 07:54:55 -0500

Thomas gravatar image

updated 2012-07-03 07:55:52 -0500

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.

edit flag offensive delete link more

Comments

1

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.

Enrique gravatar image Enrique  ( 2012-07-03 22:46:14 -0500 )edit
1

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

joq gravatar image joq  ( 2012-07-05 17:24:49 -0500 )edit

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...

Thomas gravatar image Thomas  ( 2012-07-05 22:48:40 -0500 )edit

Even without recompiling you can turn on debug output with rxconsole. That might give us a clue.

joq gravatar image joq  ( 2012-07-06 03:32:59 -0500 )edit

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.

Enrique gravatar image Enrique  ( 2012-07-18 01:33:42 -0500 )edit

That Trac ticket has been copied to github issue #42: https://github.com/ros-drivers/camera... . Please respond there is this is still a problem.

joq gravatar image joq  ( 2014-09-01 12:06:22 -0500 )edit

Question Tools

Stats

Asked: 2012-07-03 07:36:43 -0500

Seen: 2,590 times

Last updated: Jul 03 '12