After installing and building opencv 4.0 with this script, I import opencv with python and checked the version. It prints 3.2.0 instead of 4.0.0
I also found a few others with the same problem here. The answer is to export PYTHONPATH=$PYTHONPATH:${OpenCV DIR}/release/python
I'm not to familiar with using Python paths but I assume the correct statement to use is export PYTHONPATH=$PYTHONPATH:${opencv-4.0.0}/release/python_loader and reload bashrc. Is this the right way to load the recently installed opencv for python?
Here is what my directory looks like
https://i.imgur.com/z3nBd9S.png
export PYTHONPATH=~/opencv/opencv-4.0.0/release/lib/python3
Related
I need to update opencv to version 4.5.1 because there is a function that is not implemented in my current version 3.4.2. (I need to use the SIFT_create function, when I google a bit it seems that they removed it from 3.4.2 because of a patent. However, I have also heard from someone that this function has a different name in 3.4.2, so if you know this different name this is fine as well. I googled it but couldn't find anything about it.)
I tried updating opencv in the anaconda navigator but that didn't work. I tried typing
pip install opencv-python==4.0.0.21
(if I replaced 4.0.0.21 by 4.5.1 it couldn't find the version), but when I type
cv2.__version__
afterwards it still says I'm using version 3.4.2. I found this post: How to upgrade OpenCV in Anaconda (windows)? which says I should use
conda install -c conda-forge opencv=4.3.0
I do this, both the exact same command and the command with 4.3.0 replaced by 4.5.1 but in both cases I only get version 4.0.0 (which apparently also doesn't have the SIFT_create function).
Any idea what I could do?
In the meanwhile I found the answer myself (or rather: with the help of non-internet people).
The problem was that while trying to update opencv, I ended up having two versions of opencv at once. I had opencv 4.5.1 and at the same time I had opencv-python 4.0.0.21 installed. When importing opencv, it chose to import opencv-python in stead of just opencv. When I deleted the opencv-python this fixed the problem.
I have OpenCV 3.4 installed in Ubuntu 18. I also have installed ROS Melodic according to the website instructions. However, I keep on getting an error that libopencv_core.so.3.2 is required.
I already set my CMakeLists files to point to OpenCV 3.4.
However, I found out that in the file:
/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
there is the following line hardcoded in opencv3.2:
set(libraries "cv_bridge;/usr/lib/x86_64-linux-gnu/libopencv_core.so.3.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.3.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0").
I tried to change it to 3.4 but I can not rebuild it.
The error I am getting is:
/opt/ros/melodic/lib/image_view/image_view: error while loading shared libraries: libopencv_core.so.3.2: cannot open shared object file: No such file or directory
Why is OpenCV 3.2 hardcoded in cv_bridge and how can I rebuild it with OpenCV 3.4?
Update:
I eventually installed OpenCV 3.2 and it worked properly.
Because opencv development speed is much faster than ROS individual module. And a lot of ROS modules went depreciated after someone left the job.
But that's by no means the end of the day( maybe end of the day for noobs). You can build it directly with any version of opencv core function(besides imshow kind of function) others should perform just fine.
The easiest way is to do is: in the console before executing catkin_make try to execute the following
export CMAKE_PREFIX_PATH=/usr/local:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
This should give preference to your custom OpenCV installation when doing the find_package(OpenCV 3.X.0 REQUIRED). Then compile and use the function of that version.
Well if you do have to use 3.4 then I think you have to build ros version of opencv and image transport and cvbridge to the 3.4 if that's what you are targeting.
You can find the link here https://github.com/ros-gbp/opencv3-release The highest they provide seems to be 3.3
I have python 2.7.3 and netbeans 8.0 I already installed the plugins for python and works properly but I would like to use biopython but nothing is shown in the output, no even a error mnessage, I already have numpy, matplotlib, reportlab. How I could execute them in netbeans?
kind regards
I was installing QT5 and OpenCV 2.4.4 with CMAKE 2.8.10.2..
I was following the instruction from here and here .
The problem is, when I want to compile the OpenCV library with cmd, 'mingw32-make' is not recognized as internal or external command, operable program or batch file.
I don't know how to react, I've follow the instruction step by step..
Thanks for your answers :)
===============================
This question has been answered :)
the answer is I didn't put the path contains mingw32-make.exe (Qt5.0.2\Tools\MinGW\bin) to system variable. different version different path, made me confuse.
So, if you want to integrate Qt 5.0.2 and OpenCV 2.4.4 with CMAKE 2.8.10.2 in Windows 7, use instructions from two links that I mention it above, it works! Thanks:)
In start menu you can find pre-configured environment variable command prompt link for Qt MinGW. If you are using Qt 5.0.2 for Windows 32-bit (MinGW 4.7, 650 MB) you may find something like Qt 5.0.2 for Desktop (MinGW 4.7). Use it for your command. Please make sure you are using mingw32 version of Qt otherwise the command you are looking for is nmake.
I have already installed Open CV 2.4.0 beta in (D:/BACKUP/install/opencv) and installed python 2.7.2, scipy and numpy fpr 2.7 in (D:/BACKUP/install/python). Now I want to know what should I do to make it work fine. Help me with clear and step by step guide to set up my environmental variables and other settings that i should make so that i can start using it.
What about a small slice a googling/reading the doc ?
http://opencv.willowgarage.com/wiki/InstallGuide
http://luugiathuy.com/2011/02/setup-opencv-for-python/
I find this compilation of pre-compiled binaries extremely useful.
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Every time i have problems installing anything with pip, these always seem to do the trick.