Ask Your Question
1

Running opencv application on ARM

asked 2015-01-20 05:23:06 -0600

Hi,

I have cross compile the opencv for ARM as per the given procedure in link. I have copied the libraries .so and header files from build/install/ to ARM file system /usr/lib and /usr/include Now i want to write a application to simply read a image and display it. \ I have build that application with below command from my ubuntu machine

arm-linux-gnueabihf-g++-4.6 Image_read.cpp -I ../opencv_make/install/include/ ../opencv_make/lib/libopencv_calib3d.so ../opencv_make/lib/libopencv_contrib.so ../opencv_make/lib/libopencv_core.so ../opencv_make/lib/libopencv_features2d.so ../opencv_make/lib/libopencv_flann.so ../opencv_make/lib/libopencv_gpu.so ../opencv_make/lib/libopencv_highgui.so ../opencv_make/lib/libopencv_imgproc.so ../opencv_make/lib/libopencv_legacy.so ../opencv_make/lib/libopencv_ml.so ../opencv_make/lib/libopencv_objdetect.so ../opencv_make/lib/libopencv_ocl.so ../opencv_make/lib/libopencv_photo.so ../opencv_make/lib/libopencv_stitching.so ../opencv_make/lib/libopencv_superres.so

When i tried to run this application on ARM i got following error. root@dm814x-evm:~/sample_app_arm# ./a.out -sh: ./a.out: not found root@dm814x-evm:~/sample_app_arm#

as a.out is in the local folder and it is having executable permissions also..?

Please help me in this scenario, i am perfectly stuck here. Thanks in advance.

Regards Tushar

edit retag flag offensive close merge delete

Comments

It would be nice if someone would put together a step-by-step tutorial to make openCV run in an ARM board

Pedro Batista gravatar imagePedro Batista ( 2015-01-20 05:38:27 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2015-01-24 02:08:07 -0600

updated 2015-01-24 02:14:38 -0600

Hi All,

I got some solution for this,

Working environment is Linux Ubuntu 14.04

  1. Download opencv from http://opencv.org
  2. Unzip it
  3. Take linux Arago tool chain
  4. Now download cmake and cmake gui with following commands sudo apt-get install cmake cmake-curses-gui
  5. Next, Make a build library outside the opencv folder mkdir build cd build
  6. Create a file named toolchain.cmake in build folder vim toolchain.cmake
  7. Add the following to toolchain.cmake and save it. 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++ )
  8. Export the cross toolchain paths . export PATH=$PATH:../toolchain/bin/

  9. Now run cmake to generate the make file cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ../opencv_folder_path

9.Do following steps to configure the components . ccmake . disable ffmpeg here if it is not installed in your system.

  1. Now build the libraries for ARM using make make

  2. Do make install make install.

  3. Done we have build the libraries for ARM. Newly build libraries will be now in build/install/include & build/install/lib

  4. Now copy the cross build libraries to your arm file system to /usr/lib and header files to /usr/include

  5. Write a simple code using opencv like rgb_to_grey conversion. build it and now you can run it on ARM.

  6. just before running cross build binary on ARM export library path as follows LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/usr/lib

  7. Done you have done

edit flag offensive delete link more

Comments

Nice tutorial!

Pedro Batista gravatar imagePedro Batista ( 2015-01-26 04:10:04 -0600 )edit

I have opencv-2.4.9 in my laptop, i am able to run successfully opencv code, but when I try to cross compile it for friendlyARM, it show error....

and also, i could able to go till Make step, it is giving me error when i make install it.

Nayeem gravatar imageNayeem ( 2015-04-09 13:29:24 -0600 )edit

maybe u shall compile depency lib first,ffmpeg,zlib,xvidcore,x264,etc. Then put em into lib and includ of your arm-linux-gcc, then add dpkg and ld.so.conf would help u make them.

senarita gravatar imagesenarita ( 2020-04-09 09:22:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-01-20 05:23:06 -0600

Seen: 2,827 times

Last updated: Jan 24 '15