ORB_SLAM2 icon indicating copy to clipboard operation
ORB_SLAM2 copied to clipboard

Cmake: OpenCV > 2.4.3 not found. , but via pip: opencv-contrib-python (3.4.0.12) is installed

Open bubbelMCU opened this issue 6 years ago • 10 comments

hello, not sure what shall I do?
cmake cannot find opencv, which I installed for python2 and 3 via pip and the version is: opencv-contrib-python (3.4.0.12)

How to set path to opencv pip package correctly? Or do I need to recompile opencv from source?

Error message by Cmake:

-- Using flag -std=c++11.
CMake Error at CMakeLists.txt:35 (message):
  OpenCV > 2.4.3 not found.

bubbelMCU avatar Feb 25 '18 19:02 bubbelMCU

https://blog.csdn.net/gxsheen/article/details/79090454

douxiao avatar Jun 14 '18 08:06 douxiao

Having same issue with OpenCV > 2.4.3 not found.

ishanivyas avatar Sep 24 '19 22:09 ishanivyas

https://blog.csdn.net/gxsheen/article/details/79090454

It WORKS!!!

LongruiDong avatar Nov 03 '19 07:11 LongruiDong

https://blog.csdn.net/gxsheen/article/details/79090454

This really works.

Brian-ZhenLiu avatar Aug 10 '20 18:08 Brian-ZhenLiu

Could someone provide/explain the steps from the blog please? I don't understand and I've searched every other answer on the web

Wingmore avatar Aug 24 '20 01:08 Wingmore

nvm, I got it - had to add my openCV directory to Thirdparty/DBoW2/CMakeLists.txt

i.e. had to find my openCV directory. For me it was in /usr/local/include/opencv4. Then I just added SET (OpenCV_DIR /usr/local/include/opencv4) to my CMakeLists.txt file.

Wingmore avatar Aug 26 '20 03:08 Wingmore

Same error message for me in January 2021. In my case, the issue was that I just installed the latest OpenCV (as of January 2021 - OpenCV 4.5.1), but versions above OpenCV 3 are not accepted. So I downloaded and installed the latest version starting with 3 (3.4.13), and this error message has gone. (Unfortunately, I personally have other error messages now :) But at least this one seems to be solved.)

ratomatrix avatar Jan 09 '21 22:01 ratomatrix

nvm, I got it - had to add my openCV directory to Thirdparty/DBoW2/CMakeLists.txt

i.e. had to find my openCV directory. For me it was in /usr/local/include/opencv4. Then I just added SET (OpenCV_DIR /usr/local/include/opencv4) to my CMakeLists.txt file.

i can't added 'SET (OpenCV_DIR /usr/local/include/opencv4)' because the file are only to read, I tried with chmod but it's the same

Emilianocb avatar Oct 09 '22 23:10 Emilianocb

nvm, I got it - had to add my openCV directory to Thirdparty/DBoW2/CMakeLists.txt i.e. had to find my openCV directory. For me it was in /usr/local/include/opencv4. Then I just added SET (OpenCV_DIR /usr/local/include/opencv4) to my CMakeLists.txt file.

i can't added 'SET (OpenCV_DIR /usr/local/include/opencv4)' because the file are only to read, I tried with chmod but it's the same

use sudo to edit CMakeLists.txt if you are using vim type sudo vim CMakeLists.txt

DANIELHARDLY avatar Nov 23 '22 04:11 DANIELHARDLY

SET (OpenCV_DIR /usr/local/include/opencv4) where do I put it? I did already add it but same error occurs

mgrallos avatar Mar 04 '23 11:03 mgrallos