未定义参考 cv::鱼眼::校准

undefined reference to cv::fisheye::calibrate

本文关键字:鱼眼 校准 cv 参考 未定义      更新时间:2023-10-16

我正在尝试使用cv::fisheye::calibrate功能校准我的鱼眼镜头相机。但是,我在尝试编译时收到以下错误。

`undefined reference to 'cv::fisheye::calibrate(cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int> const&, cv::_InputOutputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::TermCriteria)'`

我包含了以下标题

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/features2d/features2d.hpp"

我的CMakeLists包含OpenCV2,我的ROS节点也与OpenCV链接

find_package(OpenCV 2 REQUIRED)
add_executable(cam_features src/main.cpp)
target_link_libraries(cam_features ${catkin_LIBRARIES} ${OpenCV_LIBS} ${Eigen_LIBRARIES})

不确定我哪里出错了。有人可以指出可能的错误吗?提前谢谢。

我通过清洁构建产品来解决这个问题。另外,我让软件包保留到OpenCV而不是OpenCV2。