Debug: defusedxml, CV_LOAD_IMAGE_UNCHANGED,CV_IMWRITE_JPEG_QUALITY,undistortPoints
错误日志1
运行python报:
ImportError: No module named defusedxml.
解决方法
就是有个python包没找到,装上就行:
pip install defusedxml
# 如果是系统自带的python:
sudo pip -H install defusexml
错误日志2
为python3编译ros vision_opencv中的cv_bridge时,报:
error: 'CV_LOAD_IMAGE_UNCHANGED' was not declared in this scope.
直接原因是编译器没找到opencv中这个常量的定义,根本原因是opencv4中把下面这些常量替换了:
opencv3 opencv4
CV_LOAD_IMAGE_UNCHANGED IMREAD_UNCHANGED
CV_LOAD_IMAGE_GRAYSCALE IMREAD_GRAYSCALE
CV_LOAD_IMAGE_COLOR IMREAD_COLOR
CV_LOAD_IMAGE_ANYDEPTH IMREAD_ANYDEPTH
把上面的常量名换成opencv4的就行了
错误日志3
为python3编译ros image_pipeline时,报:
error: 'CV_IMWRITE_JPEG_QUALITY' was not declared in this scope
其实原因和上面一样,常量名在opencv4中被替换了
解决方法
把CV_IMWRITE_JPEG_QUALITY
换成IMWRITE_JPEG_QUALITY
,问题解决。
错误日志4
还是编译上面的ros image_pipeline,报:
error: 'undistortPoints' is not a member of 'cv'
意思是这个函数不在cv
命名空间中。实际上cv
空间是有这个函数的,但是没include这个函数的头文件,所以没找到。
解决方法
在报错的.cpp
文件中添加头文件:
#include <opencv2/calib3d/calib3d.hpp>
问题解决