Linux Normal installation of OpenCV steps described in http://www.linuxidc.com/Linux/2013-06/86704.htm
Because it does not have administrative privileges on the TH-2, it is not possible to perform the sudo make install step when installing OPENCV, that is, you cannot install the corresponding configuration file and library file into the corresponding system folder. This requires us to change the configuration file so that when the program executes, we can find the path where the configuration file and library file are actually located.
The following is a detailed explanation of my installation process:
1. Install in the normal way, knowing that sudo make intall this step.
2. According to the view of the makefile file under the Build folder, it is found that he will generate a new folder apps,bin,lib,src and so on. 3. And went into these folders to view, found that these folders are found inside the makefile file, so I will be in each folder under the Execute Make command.
After 4.make, I found that there are various dynamic link libraries under the Lib folder (in fact, I'm not sure if the dynamic link libraries are already under the Lib folder before I execute make)
5. So I tried the sample files that were taken from these packages (under the Sample/c folder)
$ICC ' pkg-config--cflags opencv '-o mydelaunay delaunay.c ' pkg-config--libs '
Error
Package OpenCV was wasn't found in the Pkg-config search path.
Perhaps you should add the directory containing ' opencv.pc ' pkg_config_path environment
No variable ' OpenCV ' found
Based on the reference to Http://stackoverflow.com/questions/15320267/package-opencv-was-not-found-in-the-pkg-config-search-path, I wrote a opencv.pc file on my own and placed it under the ~/home/xxx/pkgconfig folder (the folder I created), which reads as follows
<span style= "FONT-SIZE:18PX;" >prefix=~/home/xxx/opencv-2.1.0
Exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${ Exec_prefix}/build/lib
NAME:OPENCV
description:the OpenCV library
version:2.1.0
cflags:-i${ INCLUDEDIR}/OPENCV
Libs:-l${libdir}-lml-lcvaux-lhighgui-lcv-lcxcore</span>
And before each execution, execute:
Export Pkg_config_path= $PKG _config_path:~/home/xxx/pkgconfig
6. The implementation $ICC ' Pkg-config--cflags opencv '-o mydelaunay delaunay.c ' pkg-config--libs ' will be successful at this moment.
Sorry: Although the final OpenCV installation was successful, the version is too low to execute its own code. And because the version of CMake in Th-2 is too low, the high version of OPENCV cannot be installed. In addition, CMake's source code installation requires administrator privileges. There is no right way to solve the problem. Later, the executing program can only find the path where the library file resides. Is it possible for me to copy the Lib and include files that were successfully installed on the other computer to the th-2, and then let the program find the library files through the path settings? When I try to do this, there is a problem of cross compiling (that is, compiling a successful file on Computer A, using it for Computer B, and having an inappropriate file format).