opencv4版本 与之前老版本之间的使用出现的问题

原先使用的都是 opencv3版本的 并未使用过opencv4.由于开发板自动系统中已经安装好了 opencv4.5版本

pkg-config --modversion opencv4
4.5.4

在编译代码的时候出现 编译报错:

/home/jetson/Projects/Demo_Show_Codes-V2.0/Demo_006-B/main.cpp: In function ‘int main():
/home/jetson/Projects/Demo_Show_Codes-V2.0/Demo_006-B/main.cpp:207:99: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
  207 | jects/Stereo_Cam/Demo_Show_Codes-V2.0/Demo_006-B/Left1.bmp", CV_LOAD_IMAGE_COLOR);
      |                                                              ^~~~~~~~~~~~~~~~~~~

/home/jetson/Projects/Demo_Show_Codes-V2.0/Demo_006-B/main.cpp:208:34: error: ‘CV_BGR2GRAY’ was not declared in this scope
  208 |  cvtColor(rgbImageL, grayImageL, CV_BGR2GRAY);
      |                                  ^~~~~~~~~~~
/home/jetson/Projects/Demo_Show_Codes-V2.0/Demo_006-B/main.cpp:221:44: error: ‘CV_GRAY2BGR’ was not declared in this scope
  221 |  cvtColor(rectifyImageL, rgbRectifyImageL, CV_GRAY2BGR);

查看发现都是 使用的opencv 4后CV_LOAD_IMAGE_COLOR 、COLOR_BGR2GRAY、CV_GRAY2BGR 定义方式改变了 。

CV_LOAD_IMAGE_COLOR
改为
cv::IMREAD_COLOR

COLOR_BGR2GRAY
改为
cv::COLOR_BGR2GRAY


CV_GRAY2BGR
改为
cv::COLOR_GRAY2BGR

GPU版本的算力问题!!!

nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

darknet_ros

运行报错:

(darknet_ros:29233): Gtk-ERROR **: 01:19:38.363: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

参考链接:参考链接

还在尝试中

(darknet_ros:31810): Gtk-ERROR **: 06:17:00.190: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

安装多版本opencv后 安装了opencv3.4.9 没有install

编译项目文件 出现问题:

Gtk-Message: 23:50:21.864: Failed to load module “canberra-gtk-module”

安装:

sudo apt-get install libcanberra-gtk-module

sudo make DESTDIR=/install/directory install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值