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

cameracalibrator.py crashes during calibration

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

mortonjt gravatar image

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

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

/camera1394stereo_node/parameter_descriptions
/camera1394stereo_node/parameter_updates
/image
/rosout
/rosout_agg
/stereo_camera/left/camera_info
/stereo_camera/left/image_raw
/stereo_camera/right/camera_info
/stereo_camera/right/image_raw

I run the following command

rosrun camera_calibration cameracalibrator.py --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 ...
OK
Waiting for service /stereo_camera/right/set_camera_info ...
OK
*** 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/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/opt/ros/groovy/lib/camera_calibration/cameracalibrator.py", line 68, in run
    self.function(m)
  File "/opt/ros/groovy/lib/camera_calibration/cameracalibrator.py", line 142, in handle_stereo
    drawable = self.c.handle_msg(msg)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/calibrator.py", 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/calibrator.py", 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/calibrator.py", line 370, in get_corners
    (ok, corners) = _get_corners(img, b, refine)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/camera_calibration/calibrator.py", 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

http://answers.ros.org/question/51072/why-there-is-no-window-show-after-i-run-the-camera_calibration-node/#52269

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.

UPDATE:

I found another program in camera_calibration folder called tarfile_calibration.py 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 tarfile_calibration.py, I get a more informative error message

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Stats

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

Seen: 1,001 times

Last updated: Apr 17 '13