Ask Your Question
-1

Get an error when trying to install openCV. I don't understand the fix.

asked 2020-05-20 19:12:41 -0600

Teejay gravatar image

I am trying to install openCV using the instructions here.

https://medium.com/@sourabhjigjinni/i...

I get the error .... "error: long: No such file or directory".

I can see the solution here.

https://answers.opencv.org/question/2...

I can see some words. They don't mean a thing to me can someone explain what I should do?

General comment. I don't understand why installing OpenCV should be see so difficult. Last time I tried I had difficulty and could only install a version a couple of generations back. Consequently I have been putting off this installation for as long as possible, but it is just as difficult again. I am pretty OK at image processing, you can look at my GitHub account and verify this https://github.com/TJCoding, but I am kind of concerned that I am putting up code on GitHub which other image processing engineers don't benefit from because they too have difficulty installing OpenCV.

edit retag flag offensive close merge delete

Comments

os ? opencv version ? compiler ? (problem seems to be bad support for mingw compiler on win)

did the answer quoted above solve it ?

berak gravatar imageberak ( 2020-05-21 01:14:46 -0600 )edit

As I stated I am following the procedure described here to implement the latest version of openCV. https://medium.com/@sourabhjigjinni/i...

That means I am using the latest version of Windows 10, the latest version of OpenCV (4.3.0), the latest version of cmake (cmake-13.17.2-win64-x64.msi which I am running from cmake-gui.exe), the latest version of tdm64-gcc (9.2.0) and the latest version of CodeBlocks (20.03).

Did the answer quoted above solve it?

No .... because as I explained the answer doesn’t mean anything to me so I can’t try to implement it.

Teejay gravatar imageTeejay ( 2020-05-21 06:14:22 -0600 )edit

Exceeded word count so 2nd comment... ...

It said “try to: cmake -DOPENCV_ENABLE_ALLOCATOR_STATS=OFF but I now believe that this should read try to: cmake-OPENCV_ENABLE_ALLOCATOR_STATS=OFF

I don’t know what “try to: cmake -OPENCV_ENABLE_ALLOCATOR_STATS=OFF”means

I have tried running Command Prompt from the directory that contains CMake.exe and when I type in the above, I get the error that the directory does not contain CMakeLists.txt. Given that there are now at least 100 instances of CMakeLists.txt on my computer across many directories, I do not know what to do next.

Teejay gravatar imageTeejay ( 2020-05-21 06:16:18 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2020-05-22 19:20:34 -0600

Teejay gravatar image

updated 2020-06-25 17:24:45 -0600

My original problem was that i did not understand what “cmake -D OPENCV_ENABLE_ALLOCATOR_STATS=OFF”means”.

The comment below answers this. (Thanks to 'bhilareakshay1')

The instructions that I was trying to follow are here.
https://medium.com/@sourabhjigjinni/i...
The instructions included at step 5.3 the need to tick and untick various options. I now realise that as part of this step I should additionally untick ‘OPENCV_ENABLE_ALLOCATOR_STATS .

This answers the question that I originally asked but it still leaves me with a further problem. When I implement the fix I still get an error.

“C:\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\9.2.0\include\c++\math.h |91|error: ‘std::_hypot’ has not been declared| modules\python3\CMakeFiles\opencv_python3.dir\build.make|82|recipe for target ‘modules/python3/CMakeFiles/ opencv_python3.dir/__/src2/cv2.cpp.obj’ failed| …………. etc”

I do not intend to raise this as a new issue because I can implement OpenCV 4.1.0 rather than Open CV 4.3.0 successfully by following the instructions that I previously referenced.

For the record, therefore using the instructions here

https://medium.com/@sourabhjigjinni/i...

I can install OpenCV using the following software versions.

https://cmake.org/files/v3.13/cmake-3...

https://sourceforge.net/projects/code...

https://sourceforge.net/projects/tdm-...

https://github.com/opencv/opencv/arch...

Now that I feel that I can reliably install OpenCV under windows, I have started again to post C++/OpenCV code upon GitHub for colour transfer methods as follows.

https://github.com/TJCoding/Ruggedise... https://github.com/TJCoding/Pitie_Ima...

edit flag offensive delete link more

Comments

1

The article is now updated to work with opencv version 4.3 In step 5, Build the Binaries, u can search for certain flags in the search bar. Here you must type and locate OPENCV_ENABLE_ALLOCATOR_STATS and make sure it is unticked. This was the flag that was causing the newer versions to break. Another option if you want opencv up and running with the least hassle, is to use pip install opencv-python, but then u are sacrificing performance for convenience

bhilareakshay1 gravatar imagebhilareakshay1 ( 2020-05-30 06:34:53 -0600 )edit

sorry to say so, but this is the most useless answer ever. you're only confusing anyone with tons of posts leading nowwhere, like in your original question

berak gravatar imageberak ( 2020-06-25 13:37:43 -0600 )edit

and goddamn, it has to be

cmake -D OPENCV_ENABLE_ALLOCATOR_STATS=OFF

berak gravatar imageberak ( 2020-06-25 13:38:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-05-20 19:12:41 -0600

Seen: 3,545 times

Last updated: Jun 25 '20