Hi-

I've successfully used cameracalibrator.py on a 640x480 image stream, but now I'm trying to use it on a 320x240 image feed. I do

$rosrun camera_calibration cameracalibrator.py --size 7x6 --square 0.0127 image:=/my_camera/image camera:=/my_camera

like the tutorial says, but it gives the following error:

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 59, in run
    self.function(m)
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 147, in handle_monocular
    scrib = cv.CreateMat(self.height / scale, self.width / scale, cv.GetElemType(rgb))
ZeroDivisionError: integer division or modulo by zero


I think the issue is line 144 in cameracalibrator.py,
scale = int(math.ceil(self.width / 640))

but if I try doing either 640.0, or changing it to 320, I get this error

Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 59, in run
    self.function(m)
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 187, in handle_monocular
    self.redraw_monocular(scrib, rgb)
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 410, in redraw_monocular
    self.buttons(display)
  File "/opt/ros/boxturtle/stacks/image_pipeline/camera_calibration/nodes/cameracalibrator.py", line 389, in buttons
    self.button(cv.GetSubRect(display, (x,180,100,100)), "CALIBRATE", self.goodenough)
error

Any ideas?

Thanks!
--Adam





Adam Leeper
Stanford University
aleeper@stanford.edu
719.358.3804