Building OpenCV for ARM Cortex-A8
来源:互联网 发布:淘宝拍摄器材 编辑:程序博客网 时间:2024/06/09 19:59
Introduction:
This wiki provides instructions that specify how to building OpenCV for ARM Cortex-A8 platform using Cmake in a linux environment. The instructions below have been tested for OpenCV 2.2 by cross compiling it on a Ubuntu 10.04 machine. The toolchain is Codesourcery 2010.12.
Build Instructions
OpenCV 2.2 uses cmake to build. Cmake is a meta-makefile system that generates makefiles. We need to install this first.
- Update Ubuntu to install and setup cmake
$ sudo apt-get install cmake cmake-curses-gui
- Download and install Codesourcery 2010.12 from http://www.codesourcery.com/sgpp/lite/arm/portal/release1600. Assuming you have installed it in /opt/arm-2010.12, add /opt/arm-2010.12/bin to your path
$ export PATH=$PATH:/opt/arm-2010.12/bin
- Now download OpenCV 2.2 from http://opencv.willowgarage.com/wiki/. Untar it into your home directory.
$ tar -jxf OpenCV-2.2.0.tar.bz2
- Cmake supports building outside the source tree. We will use this method to build OpenCV. So, create a directory in $HOME as build
$ mkdir ~/build && cd ~/build
- We need to now create a toolchain.cmake file that we will pass to cmake so that it knows how to cross-compile.
$ vi toolchain.cmake
- Add the following to toolchain.cmake and save it. This assumes that your NFS targetfs is at ~/targetfs
set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_SYSTEM_PROCESSOR arm ) set( CMAKE_C_COMPILER arm-none-linux-gnueabi-gcc ) set( CMAKE_CXX_COMPILER arm-none-linux-gnueabi-g++ ) set( CMAKE_FIND_ROOT_PATH ~/targetfs )
Important: The CMake build setup in OpenCV 2.2 and earlier does not have NEON ENABLE flag to to take advantage of neon accelearation. Hence please make the following modifications to the file CMakeLists.txt in OpenCV 2.2 to enable neon acceleration.
# Other optimizations if(USE_O2) set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -O2 -mfpu=neon") endif()
This may not be required in later versions of OpenCV since OpenCV 2.3 has the option to enable neon in the CMake build process.
- Now we run cmake to process and generate makefile
$ cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ../OpenCV-2.2.0/
- When cross compiling for ARM, I found that some items do not build. So, we need to use the cmake curses gui to customize cmake output and re-generate the makefile before we can build. Now launch the cmake curses gui to customize the make file generation
$ ccmake .
- This will bring up a screen full of options that can be edited. Make sure that the following items are OFF. If it is ON, you can toggle it by scrolling to the option and hitting Enter
- BUILD_NEW_PYTHON_SUPPORT
- BUILD_TESTS
- WITH_1394
- WITH_CUDA
- WITH_EIGEN2
- WITH_FFMPEG
- WITH_GSTREAMER
- WITH_GTK
- WITH_JASPER
- WITH_JPEG
- WITH_OPENEXR
- WITH_PNG
- WITH_PVAPI
- WITH_QT
- WITH_QT_OPENGL
- WITH_TBB
- WITH_TIFF
- WITH_UNICAP
- WITH_V4L
- WITH_XINE
Note: Do not forget to keep the USE_O2 option ON in the configuration to take adavntage of neon acceleration that you added to this option
- Now, press 'c' to configure and 'g' to generate the makefiles again.
- Now you are ready to build OpenCV. Run make from the command line and it should generate the OpenCV libraries. You can try to customize the build by turning on the various options that we disabled earlier and see if it builds for you.
- http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8
- Building OpenCV for ARM Cortex-A8
- cortex-A8 ARM核 opencv程序移植
- ARM Cortex-A8 介绍
- cortex-A8 ARM核 opencv程序移植 (2)
- cortex-A8 ARM核 opencv程序移植 (3)
- cortex-A8 ARM核 opencv程序移植 (4)
- Optimizing Code for ARM Cortex-A8 with NEON SIMD
- ARM Cortex-A8体系结构基础
- ARM Cortex A8之S5PV210
- [嵌入式]ARM Cortex-A8体系结构
- ARM Cortex-M3,Cortex-M0,Cortex-A8的主要区别
- ARM Cortex-M3,Cortex-M0,Cortex-A8的主要区别
- 三星ARM Cortex-A8 S5PV210(蜂鸟)简介
- ARM处理器的Cache之cortex a8
- opencv 移植到ti cortex a8
- opencv 移植到ti cortex a8
- opencv 2.0 移植到spv210 cortex A8
- Cortex-A8
- AS3深拷贝
- Android 定位自己当前位置信息
- treeview 加载数据的递归代码
- Javascript中最常用的55个经典技巧!【经典】
- poj2060 - Taxi Cab Scheme
- Building OpenCV for ARM Cortex-A8
- android 解析json数据格式
- 公司快3个月不能上网了!感谢第一家公司,虽然工资很少
- Python完全新手教程
- 快速阶乘运算
- wap获取手机号码,今天uc开启云加速,用公司的工具类获取是null,但是另外一个项目可以,应该这个项目的工具旧少了一些代码。。,网上找了 方法自己加可以
- 当程序员遇到像素:关于一个tab页CSS效果的调试
- hibernate HQL查询
- xp下如何用无线网卡做ap wifi热点。手机连电脑wifi上网