简体   繁体   English

OpenCV版本显示错误

[英]OpenCV version showing wrong

I had installed opencv 2.4.9 it worked fine but I was not able to use imgproc header and drawMarker functions so I decided to install opencv 4.1.0 and I ran the cmake and everything but when I check the opencv version using pkg-config --modversion opencv it shows 2.4.9. 我已经安装了opencv 2.4.9,它工作正常,但是我无法使用imgproc标头和drawMarker函数,所以我决定安装opencv 4.1.0,并运行了cmake和所有内容,但是当我使用pkg-config --modversion opencv检查opencv版本时pkg-config --modversion opencv显示2.4.9。 by the way, I use ubuntu 14.04 and want to use c++ with opencv. 顺便说一句,我使用ubuntu 14.04并想将c ++与opencv一起使用。

This is a common mistake. 这是一个常见的错误。 People are installing opencv from the first link and it is generally installing opencv 2.4.9 automatically they do not decide the version while installing. 人们正在从第一个链接安装opencv,通常是自动安装opencv 2.4.9,他们在安装时不会决定版本。

First thing you need to do is to uninstall opencv. 您需要做的第一件事是卸载opencv。 There is a post in this link how to uninstall opencv. 链接中有一篇文章如何卸载opencv。 The way I prefered: 我喜欢的方式:

sudo apt-get autoremove opencv-doc opencv-data libopencv-dev libopencv2.4-java libopencv2.4-jni python-opencv libopencv-core2.4 libopencv-gpu2.4 libopencv-ts2.4 libopencv-photo2.4 libopencv-contrib2.4 libopencv-imgproc2.4 libopencv-superres2.4 libopencv-stitching2.4 libopencv-ocl2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-video2.4 libopencv-videostab2.4 libopencv-objdetect2.4 libopencv-calib3d2.4 

Then you need to install opencv again. 然后,您需要再次安装opencv。 I strongly recommend you this link . 我强烈建议您使用此链接 Read that article carefully and do the steps. 仔细阅读该文章并执行步骤。 You can decide the opencv version in the line for example version 3.4.3: 您可以在行中确定opencv版本,例如版本3.4.3:

git checkout 3.4.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM