Ubuntu 安装 — IMSEE SDK 1.4.2 文档(ubuntu20使用官网会报错,可以参考我下面的步骤)
sudo apt-get install git
git clone https://github.com/indemind/IMSEE-SDK.git
cd # 为SDK具体路径
make init
官方文档中说ROS不需要安装opencv,实际ubuntu20已经不行了。ubuntu20 ros中自带的opencv 版本都是 4.0 以上的,而官方的动态库依赖的是ubuntu16中ros自带的3.3.1,因此这里需要手动安装3.3.1的opencv
git clone https://github.com/opencv/opencv.git
cd opencv/
git checkout tags/3.3.1
mkdir build
cd build/
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
\
-DWITH_CUDA=OFF \
\
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
..
make -j4
sudo make install #如果不想安装可不执行此步,但需要在SDK中的CmakeLists中添加 set(OpenCV_DIR "your_opencv_path/build")
*安装中可能会出现如下报错:
error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope; did you mean ‘AV_CODEC_FLAG_GLOBAL
解决方法:https://blog.csdn.net/weixin_44675820/article/details/124926975
在相应头文件中添加以下宏定义即可
#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
#define AVFMT_RAWPICTURE 0x0020
参考官方链接
cd # 为SDK具体路径
make ros
sudo su #开启权限模式
source ros/devel/setup.bash
roslaunch imsee_ros_wrapper start.launch
首先需要确保编译的时候调用的是opencv3.3.1,查看编译输出是否为
-- Found OpenCV: /home/opencv/build (found suitable version "3.3.1", minimum required is "3")
-- OpenCV version: 3.3.1
如果不是,在IMSEE-SDK/cmake/DetectOpenCV.cmake中修改,并重新make ros
set(OpenCV_DIR "your_opencv_path/build")
if(OpenCV_FIND_QUIET)
find_package(OpenCV 3 QUIET)
else()
find_package(OpenCV 3 REQUIRED)
endif()
执行下句,检查动态库链接情况
ldd IMSEE-SDK/lib/x86-64/libindemind.so | grep not
发现
libopencv_calib3d3.so.3.3 => not found
libopencv_videoio3.so.3.3 => not found
libopencv_objdetect3.so.3.3 => not found
libopencv_imgproc3.so.3.3 => not found
libopencv_core3.so.3.3 => not found
明明已经装了正确版本的opencv,且编译调用的opencv版本也正确,但这个几个动态库还是链接不到,仔细一看发现和opencv/build/lib中的动态库名字不完全相同
libopencv_calib3d3.so.3.3 #sdk需要的
libopencv_calib3d.so.3.3 #实际opencv安装的
那就比较好办了,直接复制一个或创建软链接就行(这5个动态库都需要)
cp opencv/build/lib/libopencv_calib3d.so.3.3 opencv/build/lib/ibopencv_calib3d3.so.3.3
再重新执行启动launch就正常了,如果还有问题
export LD_LIBRARY_PATH=/your_opencv_path/build/lib:$LD_LIBRARY_PATH
2.2.3 如果出现
Module Parameters Load Fail!
注意看下是否没在su权限下执行或者重新插拔相机
test-2023-08-22_10.09.40
双目图像是灰度的,做rgb的深度学习基本就用不了,镜头是大FOV的,用来做slam可能比较好,官方的sdk中的双目深度图质量实话实话很一般,感觉直接跑个opencv的开源代码也比这好。