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

image_geometry PinholeCameraModel Python not importing properly when installed using debian package

asked 2015-05-26 18:19:05 -0600

basheersubei gravatar image

updated 2015-05-28 18:22:55 -0600

I'm running Indigo (with catkin) on Ubuntu 14, and I'm trying to use the image_geometry package in Python(without roslib). When I import the package and try to instantiate a PinholeCameraModel object, it errors out and says: AttributeError: 'module' object has no attribute 'PinholeCameraModel'. Here is the full error.

I have image_geometry installed from apt-get, and my package.xml has both build_depend and run_depend for the image_geometry package. My code is below:

#!/usr/bin/env python
import rospy
import image_geometry

if __name__ == '__main__':
    cam_model = image_geometry.PinholeCameraModel()


My end goal is to run projectPixelTo3dRay() on image pixels and find their intersection with the ground plane.

I ran a Python shell session and tried dir(image_geometry) and it only displayed this: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']. I'm assuming this means it hasn't imported it properly.

Below is my PYTHONPATH in case it matters (I even added the path of image_geometry to it):


What am I doing wrong? Can someone provide an example on how to instantiate a PinholeCameraModel object? The only example I found here is where I got this from and it doesn't work.

EDIT I installed image_geometry from source and it worked just fine now... Even running dir(image_geometry) in Python shows the PinholeCameraModel correctly... I'm so baffled. Should I file a bug report? Does anyone else have this issue?

EDIT 2 I just tried this on another Ubuntu 14 machine (same setup) and it seems to work from the debian package... No idea what's going on...

edit retag flag offensive close merge delete


I have the same issue:

How did you compile from source? Just image_geometry or the whole vision_opencv package?

SimonB gravatar image SimonB  ( 2017-07-12 11:23:04 -0600 )edit

This was ages ago, so I'm not sure but I think it was just image_geometry package. Good luck! :)

basheersubei gravatar image basheersubei  ( 2017-07-12 11:55:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-17 07:34:16 -0600

SimonB gravatar image

Compile the whole vision_opencv package from source and it works:

Presumably this will get fixed in the fullness of time.

edit flag offensive delete link more

Question Tools



Asked: 2015-05-26 18:19:05 -0600

Seen: 1,422 times

Last updated: Jul 17 '17