2
$\begingroup$

I am running ROS Indigo on Ubuntu 14.04. I am doing a mono-camera calibration and trying to follow the camera calibration tutorial on the ROS Wiki.

I give the following command:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/my_camera/image camera:=/my_camera

I get the following error:

ImportError: numpy.core.multiarray failed to import Traceback (most recent call last): File "/opt/ros/indigo/lib/camera_calibration/cameracalibrator.py", line 47, in import cv2 ImportError: numpy.core.multiarray failed to import

I thought it was to do with updating numpy and did a rosdep update but no difference.

What is a possible way to solve this problem?

UPDATE: I uninstalled and reinstalled ROS completely from scratch. I still get the same error. Should I have to look somewhere outside ROS?

$\endgroup$

3 Answers 3

1
$\begingroup$

Install OpenCV-Python, it will solve the import cv2 error.

You can refer the following link for installation, Install OpenCV-Python in Windows.

$\endgroup$
0
$\begingroup$

Are you doing stereo or mono camera calibration? Can you post more code? (Please update the question, don't post code in a comment on this answer)

I ask because there's a few things to check. Highlights from the tutorial:

Start by getting the dependencies and compiling the driver.

$ rosdep install camera_calibration

$ rosmake camera_calibration

Make sure that your monocular camera is publishing images over ROS. List the topics to check that the images are published:

$ rostopic list

This will show you all the topics published, check to see that there is an image_raw topic. The default topics provided by most ROS camera drivers are: /camera/camera_info /camera/image_raw If you have multiple cameras or are running the driver in its own namespace, your topic names may differ.

$\endgroup$
3
  • $\begingroup$ Hi. So I am doing a mono-camera calibration. There is no more code to post since I am using the default ROS node. You are right about the topic names since uvc_camera pulishes in the topic /image_raw but that will not solve the error and does not as I checked it. Regarding repos, they are up to date. $\endgroup$
    – Nagsaver
    Commented Oct 7, 2015 at 1:31
  • $\begingroup$ @Nagsaver - What is the namespace of the camera you are using? Does it match the definition you are using? (camera:=\my_camera) What do you get when you list topics? Do you get any errors when you install/make camera_calibration? $\endgroup$
    – Chuck
    Commented Oct 7, 2015 at 1:41
  • $\begingroup$ I get /image_raw and /camera_info as the topics when I do rostopic list. I tried with the new topic names and it gives the same error as expected because the error is related to numpy. Regarding the camera_calibration package,it builds successfully without any errors when I do rosmake. $\endgroup$
    – Nagsaver
    Commented Oct 7, 2015 at 1:50
0
$\begingroup$

Did you try updating numpy directly? rosdep does not care about pip packages.

sudo pip install numpy -U
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.