OpenCV Cross Compile Steps For A15 Linux
OpenCV Cross Compile Steps For A15 Linux
Note: to copy from terminal – shift + ctrl + c and to paste into terminal – shift + ctrl + v
2. Let’s make a folder called ‘ti’ in the home folder and keep the OpenCV package and Vision SDK
package there
a. cd ~
b. mkdir ti
3. Download and install Vision SDK 02.11
4. Please follow the steps mentioned in VisionSDK_LinuxUserGuide.pdf in
<vision_sdk_install_path>/VISION_SDK_02_08_00_00/vision_sdk/linux/docs folder
5. It is expected that the user has installed the A15 compiler as mentioned in section 2.2.1 in the
user guide
6. So, the linaro toolchain should be found inside
~/ti/VISION_SDK_02_08_00_00/ti_components/os_tools/linux/linaro
7. OpenCV setup + applying patch
a. cd ~/ti
b. mkdir opencv
c. cd opencv
d. clone tiopencv repository using
i. git clone https://github.com/opencv/opencv.git
e. Go to the tag ticv3.1_00.04.02.00
f. Create a build directory called ‘build_arm’
8. Arm-toolchain file
a. The Linux ARM cmake toolchain is part of the patch.
b. It should be found inside the <opencv_path>/platforms/generic/ named ‘arm-
gnueabi.toolchain_vsdk.cmake’
c. The build depends on the following components:
i. GCC
ii. OpenCL (part of VSDK Linux targetfs)
iii. VXLIB
iv. DSP CGT 8.1.0
d. Go through the toolchain and edit the appropriate paths to point to the appropriate
modules path mentioned earlier
Note: Let’s keep the FLOAT_ABI_SUFFIX as ‘hf’ only and not disturb it unless required
g. Click configure
h. Click generate
i. Close cmake
j. Cmd: make –j4
k. Cmd: make install
12. If the above build fails, with an assembler statement saying “offset out of range”, we need the
64-bit version of the same toolchain
a. Get the toolchain package
i. Cmd: sudo gedit /etc/apt/sources.list
ii. Go to eof
iii. Add the line – deb http://cz.archive.ubuntu.com/ubuntu trusty main universe
iv. Save and close the file
v. Cmd: sudo apt-get update
b. Cmd: sudo apt-get install gcc-4.7-arm-linux-gnueabihf
c. Cmd: sudo apt-get install g++-4.7-arm-linux-gnueabihf
13. Edit the arm-toolchain file if step 12 was followed
a. Open terminal – ctrl + alt + t
b. gedit ~/ti/opencv/opencv-3.1.0/platforms/linux/arm-gnueabi.toolchain.cmake
c. Edit the following lines
i. find_program(CMAKE_C_COMPILER NAMES arm-linux-
gnueabi${FLOAT_ABI_SUFFIX}-gcc-4.7)
ii. find_program(CMAKE_CXX_COMPILER NAMES arm-linux-
gnueabi${FLOAT_ABI_SUFFIX}-g++-4.7)
iii. set(ARM_LINUX_SYSROOT /usr/arm-linux-gnueabihf PATH "ARM cross
compilation system root")
14. Go to project configuration
a. Clear cache
b. Repeat step 11(Configuring OpenCV project..)
c. Now the build should be successful
15. Installing the libraries
a. Run this command
i. Cmd: make install
b. This will install the headers and libraries in install folder inside the build_arm folder
c. The demo or test executables can be found inside the bin folder of build_arm folder
S. No Modules
1 calib3d
2 core
3 features2d
4 flann
5 imgcodecs
6 imgproc
7 ml
8 objdetect
9 photo
10 shape
11 stitching
12 superres
13 video
14 videostab
1/256 of | 1 4 6 4 1|
| 4 16 24 16 4|
| 6 24 36 24 6|
| 4 16 24 16 4|
| 1 4 6 4 1|
cv::Sobel 8-bit single channel input; only 3x3 structuring is supported; 2.12
sobel xy calculates magnitude also and output is 16-bit single
channel
cv::Resize 8-bit single channel input; only bilinear and downscaling to half 2.12
size is supported
cv::Integral 8-bit single channel input; 2.12
cv::CalcHist 8-bit single channel input; only 256 bins and range of 256 is 2.12
supported
cv::EqualizeHist 8-bit single channel input 2.12
*Note: In order to build the TI OpenCL files, pleae run ‘cmake’ which builds it.