ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0 crashes during calibration

asked 2013-04-07 12:41:25 -0500

mortonjt gravatar image

updated 2013-04-10 14:43:42 -0500

Hello. I'm trying to calibrate the bumblebee2. I'm currently using camera1394 stereo and the following topics are being published.


I run the following command

rosrun camera_calibration --size 8x6 --square 0.108 right:=/stereo_camera/right/image_raw left:=/stereo_camera/left/image_raw right_camera:=/stereo_camera/right left_camera:=/stereo_camera/left -k 6

Then I either get a Segmentation Fault or I get the following error message

Waiting for service /stereo_camera/left/set_camera_info ...
Waiting for service /stereo_camera/right/set_camera_info ...
*** Added sample 1, p_x = 0.465, p_y = 0.760, p_size = 0.138, skew = 0.003
OpenCV Error: Assertion failed (blockSize % 2 == 1 && blockSize > 1) in adaptiveThreshold, file /tmp/buildd/ros-groovy-opencv2-2.4.4-1oneiric-20130301-2020/modules/imgproc/src/thresh.cpp, line 797
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 552, in __bootstrap_inner
  File "/opt/ros/groovy/lib/camera_calibration/", line 68, in run
  File "/opt/ros/groovy/lib/camera_calibration/", line 142, in handle_stereo
    drawable = self.c.handle_msg(msg)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 1028, in handle_msg
    rscrib_mono, rcorners, rdownsampled_corners, rboard, _ = self.downsample_and_detect(rgray)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 402, in downsample_and_detect
    (ok, downsampled_corners, board) = self.get_corners(scrib, refine = True)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 370, in get_corners
    (ok, corners) = _get_corners(img, b, refine)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 156, in _get_corners
    (ok, corners) = cv.FindChessboardCorners(mono, (board.n_cols, board.n_rows), cv.CV_CALIB_CB_ADAPTIVE_THRESH | cv.CV_CALIB_CB_NORMALIZE_IMAGE | cv2.CALIB_CB_FAST_CHECK)
error: blockSize % 2 == 1 && blockSize > 1

I found a post with a similar problem at the following link

The errors are rather inconsistent -- the problem sometimes crashes immediately or crashes after a dozen readings.

I have tried different lighting environments and tinkered with rqt_configure and I'm currently at a loss about what could be causing this problem. Any help would be greatly appreciated.


I found another program in camera_calibration folder called I have written my own image capture node that can two pictures simultaneously with each camera and have obtained around 70 images. When I ran, I get a more informative error message

Traceback (most recent call last):
  File "/opt/ros/groovy/lib/camera_calibration/", line 112, in <module>
    cal_from_tarfile(boards, tarname, options.mono, upload=options.upload)
  File "/opt/ros/groovy/lib/camera_calibration/", line 51, in cal_from_tarfile
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 1134, in do_tarfile_calibration, rimages)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 847, in cal
    goodcorners = self.collect_corners(limages, rimages)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/", line 864, in collect_corners
    raise ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-17 10:01:58 -0500

mortonjt gravatar image

We just upgraded our OS form Ubuntu 11.10 32-bit to Ubuntu 12.10 64-bit and now the camera calibration works flawlessly. I'm now pretty convinced that this problem is a 32-bit problem

edit flag offensive delete link more

Question Tools


Asked: 2013-04-07 12:41:25 -0500

Seen: 956 times

Last updated: Apr 17 '13