opencv Cross compilation for ARM based Linux systems
来源:互联网 发布:数据安全管理方法 编辑:程序博客网 时间:2024/06/07 16:13
http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html
Cross compilation for ARM based Linux systems
This steps are tested on Ubuntu Linux 12.04, but should work for other Linux distributions. I case of other distributions package names and names of cross compilation tools may differ. There are several popular EABI versions that are used on ARM platform. This tutorial is written for gnueabi and gnueabihf, but other variants should work with minimal changes.
Prerequisites
Host computer with Linux;
Git;
CMake 2.6 or higher;
Cross compilation tools for ARM: gcc, libstc++, etc. Depending on target platform you need to choose gnueabi or gnueabihf tools. Install command for gnueabi:
sudo apt-get install gcc-arm-linux-gnueabiInstall command for gnueabihf:
sudo apt-get install gcc-arm-linux-gnueabihfpkgconfig;
Python 2.6 for host system;
[optional] ffmpeg or libav development packages for armeabi(hf): libavcodec-dev, libavformat-dev, libswscale-dev;
[optional] GTK+2.x or higher, including headers (libgtk2.0-dev) for armeabi(hf);
[optional] libdc1394 2.x;
[optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev for armeabi(hf).
Getting OpenCV Source Code
You can use the latest stable OpenCV version available in sourceforge or you can grab the latest snapshot from our Git repository.
Getting the Latest Stable OpenCV Version
- Go to our page on Sourceforge;
- Download the source tarball and unpack it.
Getting the Cutting-edge OpenCV from the Git Repository
Launch Git client and clone OpenCV repository
In Linux it can be achieved with the following command in Terminal:
cd ~/<my_working _directory>git clone https://github.com/Itseez/opencv.git
Building OpenCV
Create a build directory, make it current and run the following command:
cmake [<some optional parameters>] -DCMAKE_TOOLCHAIN_FILE=<path to the OpenCV source directory>/platforms/linux/arm-gnueabi.toolchain.cmake <path to the OpenCV source directory>
Toolchain uses gnueabihf EABI convention by default. Add -DSOFTFP=ON cmake argument to switch on softfp compiler.
cmake [<some optional parameters>] -DSOFTFP=ON -DCMAKE_TOOLCHAIN_FILE=<path to the OpenCV source directory>/platforms/linux/arm-gnueabi.toolchain.cmake <path to the OpenCV source directory>
For example:
cd ~/opencv/platforms/linuxmkdir -p build_hardfpcd build_hardfpcmake -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake ../../..
Run make in build (<cmake_binary_dir>) directory:
make
Note
Optionally you can strip symbols info from the created library via install/strip make target. This option produces smaller binary (~ twice smaller) but makes further debugging harder.
Enable hardware optimizations
Depending on target platform architecture different instruction sets can be used. By default compiler generates code for armv5l without VFPv3 and NEON extensions. Add -DENABLE_VFPV3=ON to cmake command line to enable code generation for VFPv3 and -DENABLE_NEON=ON for using NEON SIMD extensions.
TBB is supported on multi core ARM SoCs also. Add -DWITH_TBB=ON and -DBUILD_TBB=ON to enable it. Cmake scripts download TBB sources from official project site http://threadingbuildingblocks.org/ and build it.
- opencv Cross compilation for ARM based Linux systems
- arm-linux-gdb: makeinfo is required for compilation
- Cross-compiling for ARM
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- 编译OpenCV for arm-linux
- Cross compiling wxDFB-2.8.11 for ARM-Linux
- linux arm cross-compile
- Field-Based Coordination for Pervasive Multiagent Systems
- Logical Foundations for Rule-Based Systems
- Computational Intelligence for Agent-based Systems
- Cross compiling Libx264 for ARM
- Power Management in Linux-Based Systems
- 编译OpenCV for arm-linux (转)
- YOLO: Real-Time Object Detection
- 山东省第二届ACM大学生程序设计竞赛 Identifiers
- mysql查询优化技巧
- WCF messageheader校验头
- 汇编学习第二课之 CS:IP,DS,SS:SP 寄存器
- opencv Cross compilation for ARM based Linux systems
- 互斥量与条件变量
- NSView 遍历subview
- Druid基本配置及内置监控使用
- WebView网页中使用到支付宝调不起来,提示ERR_UNKNOWN_URL_SCHEME
- Spring 自己学习心得(AOP)s实现
- jquery字符串转日期类型
- Swift 根据文字字体的大小得到size
- web前端面试题及答案 html篇 下