Ask Your Question

OpenCV PinholeCameraModel undefined reference

asked 2012-07-25 07:00:51 -0500

David Bravo gravatar image

updated 2016-10-24 09:10:48 -0500

ngrennan gravatar image

Hi, I'm trying to the the camera model information by using:

void cameraModel_cb(const sensor_msgs::CameraInfoConstPtr &info_msg) { image_geometry::PinholeCameraModel model_; model_.fromCameraInfo(info_msg); fx = model_.fx(); fy = model_.fy(); }

Where info_msg is /camera/depth_registered/camera_info from the openni.launch node. I need the IR camera focal lenght in order to get range images using:

range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, fx, fy, angular_resolution_);

The problem is that I keep getting this error:

CMakeFiles/keypointsplanar.dir/src/keypointsplanar.o: In function cameraModel_cb(boost::shared_ptr<sensor_msgs::CameraInfo_<std::allocator<void> > const> const&)': /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:26: undefined reference toimage_geometry::PinholeCameraModel::PinholeCameraModel()' /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:27: undefined reference to `image_geometry::PinholeCameraModel::fromCameraInfo(boost::shared_ptr<sensor_msgs::camerainfo_<std::allocator<void> > const> const&)' collect2: ld returned 1 exit status

when trying to compile my program. I linked the libraries in the CMakeList file like this:

FIND_PACKAGE( OpenCV REQUIRED ) rosbuild_add_executable (keypointsplanar src/keypointsplanar.cpp) TARGET_LINK_LIBRARIES( keypointsplanar ${OpenCV_LIBRARIES} )

I'd really appreciate some help with this problem, thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-08-27 12:09:23 -0500

Mac gravatar image

updated 2012-08-27 12:09:37 -0500

You'll need to add the image_geometry package to your manifest.xml as a dependency.

edit flag offensive delete link more


It worked for me..thanks

sai gravatar image sai  ( 2013-03-10 01:52:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-07-25 07:00:51 -0500

Seen: 851 times

Last updated: Aug 27 '12