Transplanting OpenCV2.2.0 to ARM cortex-A9 Platform

本文档详细记录了如何将OpenCV 2.2.0移植到ARM Cortex-A9平台,如PandaBoard(OMAP4430)。内容包括安装和配置交叉编译器、下载OpenCV源码、创建工具链文件、修改CMakeLists.txt以启用NEON加速、解决编译过程中遇到的问题,以及测试编译后的动态库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

移植 OpenCV 2.2.0 到 ARM Cortex-A9 平台


Keyword: OpenCV2.2.0ARMCortex-A9OMAP4430PandaBoard,cross-compile



这篇文章我也上传到了google doc ,方便大家一起参与编辑与完善。

link: https://docs.google.com/document/d/1Yk2Fv5kC1V8kZuDDpuMUqUqNaYj9MULrfGVubhyt22g/edit?pli=1



Develop environment

Host: ubuntu 10.10

OpenCV version: 2.2.0

Cross-Compiler version: 4.5.1

Target-Platform:PandaBoard (Omap 4430)

Kernel version: 2.6.35

Recently I got anproject want to use OpenCV in ARM platform . Though we got lot ofguides and manuals from Internet. But because of the board I have isomap4430 which contains dual-core Crotex-A9. I have to usehigh-version cross-compiler and high-version OpenCV source code .

I spend nearly twoweeks to finish this work. Not only the processing I record but alsothe problems I got and the solution I found in this guide . I reallyhope this guide will help you transplant smoothly. You are also verywelcomed to commit problem or advice you got to help me completethis guide.

As we know , OpenCVusing cmake to configure and generate Makefile from version2.1.0(including 2.1.0). That has a lot of different with“./configure+arguments”mode. cmake-curses-gui is a tool of cmake,which can help us configure and modify arguments with a simple GUIinstead of complex command arguments. Before transplantation we haveto prepare tools, cross-compiler and sources.

1.Install cmake

sudo apt-get install cmake


2.Install cmake-curses-gui

sudo apt-get installcmake-curses-gui

NOTE:


Problem you may encounter:cmake-curses-gui depends =2.8.0-5ubuntu1But cmake was installed depends 2.8.2-2ubuntu0.1library.

Solution: UseSynaptic package Manager remove high-version cmake youhad. Then force install cmake in version 2.8.0-5ubuntu1 . Afterthat cmake-curses-gui will install successful. Don't forget to“Apply” them.


3.DownloadCross-Compiler and Source Code we need

    1. Download and installCodesourcery 2010.12 .

DownloadURL:http://www.codesourcery.com/sgpp/lite/arm/portal/release1600 This arm-linux-gcc version is 4.5.1.


    1. Unzip and export it toyour path.


tar -xvjf./arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

-C /opt

exportPATH=$PATH:/opt/arm-2010.12/bin


To check you haveinstalled and configure it correct.

arm-none-linux-gnueabi-g++-v


If you installed andconfigure it successful, you will see following information :


Configured with:/scratch/nathan/arm-lite/src/gcc-4.5-2010.09/configure--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu--target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap--disable-libssp --disable-libstdcxx-pch--enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as--with-gnu-ld --with-specs='%{save-temps: -fverbose-asm}%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}-D__CS_SOURCERYGXX_MAJ__=2010 -D__CS_SOURCERYGXX_MIN__=9-D__CS_SOURCERYGXX_REV__=50 %{O2:%{!fno-remove-local-statics:-fremove-local-statics}}%{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics:-fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared--enable-lto --enable-symvers=gnu --enable-__cxa_atexit--with-pkgversion='Sourcery G++ Lite 2010.09-50'--with-bugurl=https://support.codesourcery.com/GNUToolchain/--disable-nls --prefix=/opt/codesourcery--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc--with-build-sysroot=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/libc--with-gmp=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--with-mpfr=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--with-mpc=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--with-ppl=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic-lm'--with-cloog=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--with-libelf=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr--disable-libgomp --enable-poison-system-directories--with-build-time-tools=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/bin--with-build-time-tools=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/bin


Thread model: posix


gcc version 4.5.1(Sourcery G++ Lite 2010.09-50)


  1. Then download and unzipOpenCV sources.

DownloadURL:http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/


tar -xvjfOpenCV-2.2.0.tar.bz2 -C /YOURDIR

NOTE: you'd better choosea directory which have permission to compile.


4.Create a builddirectory to avoid mixing install files with source code.

mkdir/YOURDIR/build && cd /YOURDIR build


5.Create atoolchain.cmake file .This file is used to tell cmake how tocross-compile,and some other infromation

gedit./toolchain.cmake


6.Paste following totoolchain.cmake and save it . Last /DIR means the path you want toinstall.

set( CMAKE_SYSTEM_NAMELinux )

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 /DIR )


NOTE: If you not sure to your PATH. I suggest using an absolute pathlike this: /opt/toolschain/4.5.1/bin


### Android Native UI Frameworks and Libraries In the context of developing applications for Android, a variety of native UI frameworks and libraries are available to enhance user interface creation. One such framework is described as driving off the UI of both Android native and hybrid developments[^1]. This indicates that there exists an integrated approach where developers can leverage components designed specifically for enhancing or customizing the look and feel of their application&#39;s interfaces. For those looking into customization at deeper levels within the system, efforts have been made towards transplanting `Android SystemUI` applications which not only aids in understanding how one might customize aspects of the device’s appearance but also sets up groundwork for future customized applications[^2]. When it comes to integrating rich messaging features directly through React Native projects targeting iOS devices, RCTAuroraIMUI has emerged as a solution by providing pre-built functionalities packaged neatly inside `.framework`, facilitating easier inclusion of chat-related capabilities without needing extensive coding from scratch[^3]. However, when considering ease alongside versatility across platforms including web technologies (HTML/CSS), some prefer using cross-platform tools like Xamarin due to its ability to achieve near-native performance while allowing code sharing between different operating systems; yet opinions vary on whether this outweighs simplicity offered by hybrids built primarily around JavaScript-based stacks[^4]. #### Example Code Snippet Demonstrating Use of Custom View in XML Layout File ```xml <com.example.customviews.CustomButton android:id="@+id/custom_button" android:layout_width="wrap_content" android:layout_height="wrap_content" app:textColor="#FFFFFF"/> ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值