I’m trying to install a version of OpenCV with CUDA support on reComputer J1010, but I can only get version 3.2.0 using the command: sudo apt-get install python3-opencv. I’ve been trying to compile OpenCV, but I always encounter errors. Is there a simple way to obtain it?
Hello, Walter1605! I have some methods for your problem.However, the following steps are somewhat difficult.I hope to help you: Because GCC and GLIBC have different versions under different Linux versions (SuSE, Debian, Ubuntu, and so on), the precompiled version of OpenCV’s Linux does not contain the Linux version number.
However, in many cases, your Linux version will provide OpenCV. If your version does not provide OpenCV, you will have to build from the source code, which can be downloaded from the official website as with Windows installation, but in this case, the link will direct you to SourceForge, where you can select a compressed file for the current OpenCV source code.
In order to compile the library and the sample program, you need to prepare a number of libraries or tools, including:
1.GTK+ 2.x or later.
3.cmake build tool;
4.libtbb (Intel Thread building block);
5.There are also optional projects such as developer versions of zlib, libpng, libjpeg, libtiff, and libjasper (for example, versions with -dev after the module name).
7.You also need to use Python 2.6 or later (developer package) and NumPy to make OpenCV work in Python environment.
8.In addition, you also need libavcodec from ffmpeg and other libav* libraries (including header files).
For the latter, install the libav/ffmpeg package provided with your Linux distribution. The ffmpeg library has a lower General Public (LGPL) license, but some of its components have a more stringent General Public License (GPL). To work with non-GPL software, you need to build and use a shared ffmpeg library:
$> ./configure --enable-shared $> make $> sudo make install
When dynamically linking an LGPL library, you do not need to use the GPL license for your own code. The final result:
The preceding files are in the /usr/local/include/libav* directory
To compile the library, unzip the tar.gz file and switch to the source folder created during the unzip process, then do the following:
mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. make sudo make install # optional
Description of the instruction:
- The first and second commands will create a subdirectory named release and switch to release.
- The third command tells the cmak tool how to set up your project. The examples we’ve provided may be the right way to get you started, but other options allow you to enable more Settings, such as:
Determines which examples need to be built;
Added support for Python.
Added support for CUDA Gpus.
By default, OpenCV’s cmak configuration script tries to find and use as many third-party libraries as possible, such as automatically supporting GPU-accelerated OpenCV features if it detects the presence of the CUDA SDK.
- The last two instructions will compile the entire library and install it to the correct location. Note that if you use CMake to build your project, there is no need to install OpenCV, just specify the path to the generated OpenCVConfig.cmake component. In the previous example, the file will be installed at /usr/local/share/OpenCV.
As the Windows example shows, OpenCV built on Linux will automatically take advantage of IPP for acceleration (if installed). Starting with OpenCV 3.0, OpenCV’s cmak setup script will automatically download and link to an IPP free sublibrary (IPPICV). If you want to disable IPP acceleration, execute CMake with the -D WITH_IPP=OFF directive
Ok… I didn’t understand 90% of what you said hahaha, but I’ll try to do it. I just wanted to know if this solution can be used only with the internal eMMC that the reComputer J1010 has since I’m not using (and don’t plan to use) a microSD memory card.
When you run sudo apt-get install python3-opencv, do you get the error: cannot open shared object file: No such file or directory？First you need to update the software source with your system, for example: sudo apt i update… I think these detailed steps can be found in some developer communities, such as CSDN.